Controlling the Usage Service via Environment Variables
Information about using environment variables to control the usage service or to change the event that is reported to the usage service
This article contains information about how to control the usage service via environment variables. You can:
- Control how the usage service operates.
- Modify the event that is sent to the usage service.
Controlling the Usage Service via Environment Variables
Three environment variables allow you to control the usage service. You can enable or disable the collection of usage metrics, change the URL where results are reported, and change the user's distinct ID.
If your client is unable to contact the usage service, it will retry by replacing https with http in the URL (set using the AXE_METRICS_URL environment variable).
Changing the Reported Event Using Environment Variables
With the environment variables below, you can change the event that is reported to the usage service. For instance, you can change the department or organization properties on each event to associate API or CLI usage to a specific department or organization.
The Can Override column indicates whether the value set in the environment variable can override a value that was already set programmatically via the metrics library. A dash (—) in the Can Override column indicates that the concept does not apply to that variable.
Environment Variables
| Name | Type | Can Override | Description |
|---|---|---|---|
AXE_DISTINCT_ID |
String | — | A UUID identifier that remains the same for the logged-in user (unless it is regenerated) |
AXE_METRICS_URL |
String | — | The URL of the REST usage endpoint |
AXE_TRACK_USAGE |
Boolean | — | Enables usage service reporting (default is false) |
AXE_APPLICATION |
String | false | The application that was used to check for accessibility errors |
AXE_DEV_INSTANCE |
Boolean | true | Indicates whether this event is from a software developer's actions. Useful for marking and later removing events logged during development or testing. |
AXE_DEPARTMENT |
String | true | The user's department within the organization |
AXE_KEYCLOAK_ID |
String | false | The user's Keycloak ID |
AXE_LOGGED_IN |
Boolean | false | Records whether the user is logged in to the application under test |
AXE_ORGANIZATION |
String | true | The user's organization |
AXE_SESSION_ID |
String | false | A UUID identifying the user's session |
AXE_USER_ID |
String | false | A specific user's identity such as name or login ID |
AXE_USER_JOB_ROLE |
String | false | The user's job role |
AXE_USER_STATUS |
String | false | Status information you want to associate with the user |
See Also
For tutorials demonstrating how to use these environment variables, see Getting Started with the Usage Service and the APIs and Getting Started with the Usage Service and the CLI.
For general information on the usage service, see The Axe DevTools for Web Usage Service.
