How to install the Add Request ID integration through Azion Marketplace
The Azion Add Request ID integration enables you to add an additional header in the incoming request object, assigning a unique identifier to each HTTP request attended by Azion Edge Platform.
This identifier facilitates you in tracking and identifying individual requests, as well as allows you to analyze logs and identify issues. This way, you can cross-reference data from observability products, such as Azion Data Stream and Real-Time Events, with the internal logs of your infrastructure.
Getting the integration
To install Azion Add Request ID:
- Access Azion Console > Marketplace.
- On the Marketplace’s homepage, select the integration’s card.
- Once the integration page opens, click the Install button.
A success message appears to confirm that your integration is installed.
- Access Real-Time Manager (RTM) > Marketplace.
- On the Marketplace’s homepage, select the integration’s card.
- Once the integration page opens, click the Get It Now button, at the bottom-right corner of the page.
A success message appears to confirm that your integration is installed.
Configuring the integration
Setting up an edge firewall
To do so, follow the steps:
- On the upper-left corner, select Products menu > Edge Firewall in the Secure section.
- Click the + Edge Firewall button.
- Give an easy-to-remember name to your edge firewall.
- Select the domains you want to protect with the function.
- Enable the Edge Functions switch in the Modules section.
- Click the Save button.
Done. Now you’ve instantiated the edge firewall for your integration and it has access to edge functions.
- On the upper-left corner, select Products menu > Edge Firewall in the SECURE section.
- Click the Add Rule Set button.
- Give an easy-to-remember name to your edge firewall.
- Select the domains you want to protect with the function.
- Enable the Edge Functions switch in the Modules section.
- Click the Save button.
Done. Now you’ve instantiated the edge firewall for your integration and it has access to edge functions.
Setting up the function
While still on the Edge Firewall page:
- Select the Functions Instances tab.
- Click the + Function Instance button.
- Choose an easy-to-remember name for your function.
- On the dropdown menu, select the Add Request ID function.
- This action will load the Arguments tab.
In this case, the Add Request ID function can be used without any arguments. However, it has a single optional argument that can be used to modify the name of the header where the Request ID will be inserted.
JSON Args key | Environment Variable Name | Data Type | Default Value | Description |
---|---|---|---|---|
header_name | AZION_REQUEST_ID_HEADER_NAME | String | x-azn-request-id | The name of the header where the function will insert the Request ID. If the argument isn’t a non-empty string, then the function will use the default value |
- When you’re done, click the Save button.
- Select the Functions tab.
- Click the Add Function button.
- Give an easy-to-remember name to your instance.
- On the dropdown menu, select the Add Request ID function.
This action will load the function, showing a form with the function code and, just above it, two tabs: Code and Args.
By clicking the Code tab, you’ll be able to navigate through the source code but not change it.
On the Args tab, you’ll pass your variables. In this case, the Add Request ID function can be used without any arguments. However, it has a single optional argument that can be used to modify the name of the header where the Request ID will be inserted.
JSON Args key | Environment Variable Name | Data Type | Default Value | Description |
---|---|---|---|---|
header_name | AZION_REQUEST_ID_HEADER_NAME | String | x-azn-request-id | The name of the header where the function will insert the Request ID. If the argument isn’t a non-empty string, then the function will use the default value |
- When you’re done, click the Save button.
Setting up the Rules Engine
To finish, you have to set up a Rules Engine to configure the criteria and the behavior to run the function.
Still in the Edge Firewall page:
- Select the Rules Engine tab.
- Click the + Rule Engine button.
- Give an easy-to-remember name to the rule.
- You can add a description, but it’s an optional step.
- Select a criteria to run and catch the domains that you want to run the integration on. Example:
if Hostname is equal xxxxxxxxxxxx.map.azionedge.net
. - Below, select a behavior Run Function.
- Select the adequate function according to the name you gave it in the previous step.
- Click the Save button.
Done. You’ve now configured the Add Request ID integration and will start receiving the header.
- Select the Rules Engine tab.
- Click the New Rule button.
- Give an easy-to-remember name to the rule.
- You can add a description, but it’s an optional step.
- Select a criteria to run and catch the domains that you want to run the integration on. Example:
if Hostname is equal xxxxxxxxxxxx.map.azionedge.net
. - Below, select a behavior Run Function.
- Select the adequate function according to the name you gave it in the previous step.
- Click the Save button.
Done. You’ve now configured the Add Request ID integration and will start receiving the header.