Metrics service configuration variables
Review configuration variables to customize metrics service deployment, database connections, security settings, and operational parameters.
Inventory variables reference
Required variables for automationmetrics group
The following variables must be defined when deploying metrics service with the containerized installer:
| Variable | Default | Required/Optional | Description |
|---|---|---|---|
automationmetrics_pg_host |
(none) | Required | PostgreSQL host for the metrics database |
automationmetrics_pg_password |
(none) | Required* | Password for the metrics database user. *Not required whenautomationmetrics_pg_cert_auth: true is set. |
automationmetrics_controller_read_pg_host |
(none) | Required* | PostgreSQL host for the controller database |
automationmetrics_controller_read_pg_password |
(none) | Required* | Password for the read-only controller database user. *Not required whenautomationmetrics_pg_cert_auth: true is set. |
Optional variables with defaults
| Variable | Default | Description |
|---|---|---|
automationmetrics_pg_port |
5432 |
PostgreSQL port |
automationmetrics_pg_database |
metrics_service |
Database name |
automationmetrics_pg_username |
metrics_service |
Database user |
automationmetrics_api_port |
8006 |
Port the metrics service API listens on (Gunicorn) |
automationmetrics_nginx_http_port |
8087 |
nginx HTTP port (redirects to HTTPS) |
automationmetrics_nginx_https_port |
8450 |
nginx HTTPS port |
automationmetrics_pg_cert_auth |
false |
Use certificate authentication instead of passwords |
Note on certificate authentication: When automationmetrics_pg_cert_auth: true, password variables (automationmetrics_pg_password and automationmetrics_controller_read_pg_password) are not required. The service uses PostgreSQL certificate-based authentication instead.
Indirect node audit data retention Copy linkLink copied!
Collection alone is not sufficient: the source audit records must still exist in the controller database when a collection runs. The controller retains indirect node audit records in the main_indirectmanagednodeaudit table for a limited period, then purges older records. If audit records are purged before they are collected, that data is lost and cannot be recovered. The controller retention period does not apply to metrics service data. The controller stores raw indirect node audit records (one per host per job), which grow large and are purged after 7 days by default. Metrics service stores only aggregated daily counts by collection and module, which are small and can be retained for much longer.
|
Variable |
Default |
Level |
Description |
|
INDIRECT_HOST_AUDIT_RECORD_MAX_AGE_DAYS |
7 |
Automation controller setting |
Number of days the automation controller retains indirect node audit records before purging them. This is an automation controller setting, not a metrics service automationmetrics_* inventory variable. It is set as a default and can be overridden with an environment variable or settings file. It is not exposed as a controller UI or API configuration setting. |
INDIRECT_HOST_AUDIT_RECORD_MAX_AGE_DAYS to cover the full interval between gathers.|
Variable |
Default |
Customer-togglable |
Description |
|---|---|---|---|
|
|
True |
Yes. Settings > System UI, the /api/v2/settings/system/ API, or awx-manage set_indirect_node_counting |
Controls whether the controller records indirect node audit data at all. |
|
|
7 |
No. Settings file or environment variable only |
Retention window for raw audit records, described above. |
|
|
60 |
No. Settings file or environment variable only |
How long the controller waits before the hourly fallback job picks up a job whose indirect node audit record was not recorded by the immediate path. |
|
|
3 |
No. Settings file or environment variable only |
How long the controller keeps retrying a job whose events failed to process before giving up. |
If a job's events fail to process for longer than INDIRECT_HOST_QUERY_FALLBACK_GIVEUP_DAYS (3 days by default), the controller gives up and never creates an audit record for that job. This loss is permanent and independent of the 7-day retention window. Increasing INDIRECT_HOST_AUDIT_RECORD_MAX_AGE_DAYS does not recover it, because there was never a record to purge.
Events collector settings
The events collector (main_jobevent_service) processes job event data to extract collection, module, and role usage statistics. These variables are configurable as Django settings or environment variables without a code change. Use them to control collection volume on large deployments.
| Variable | Default | Description |
|---|---|---|
JOBEVENT_ROW_LIMIT |
200,000 | Maximum number of job event rows to process per hourly collection cycle. Set to 0 for unlimited processing. |
JOBEVENT_JOB_LIMIT |
1,000 | Maximum number of jobs to process for event data per hourly collection cycle. Set to 0 for unlimited processing. |
JOBEVENT_ROW_LIMIT or JOBEVENT_JOB_LIMIT to 0 removes the limit entirely, causing the collector to process all available events. On large deployments with high job volumes, this can significantly increase collection time and database load. To effectively disable event collection for performance reasons, set both values to 1.