Configure the metrics-utility
Configure the metrics-utility to gather and report usage data for your Ansible Automation Platform, both on Red Hat Enterprise Linux and OpenShift Container Platform.
Configure the metrics-utility on Red Hat Enterprise Linux Copy linkLink copied!
You can configure the metrics-utility on a Red Hat Enterprise Linux system to gather and report usage metrics for automation controller.
Before you begin Copy linkLink copied!
- Subscription: An active Ansible Automation Platform subscription.
- Installation: The
metrics-utilitytool is included by default with the Ansible Automation Platform installation on the automation controller node. No separate installation is required. - User privileges: You must be logged in as the
rootuser or theawxuser to run themetrics-utilitytool.
The metrics-utility requires read access to /etc/tower/SECRET_KEY to function correctly. Attempting to run this utility as a standard user (non-root or non-awx) results in a PermissionError and execution failure.
The following procedure gathers the relevant data and generate a CCSP report containing your usage metrics. You can configure these commands as cron jobs to ensure they run at the beginning of every month. See How to schedule jobs using the Linux cron utility for more on configuring using the cron syntax.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
Use the following verification steps to ensure correct configuration:
- To confirm that your
cronjob entries have been saved correctly, run:crontab -l - Inspect the
cronlog to verify that thecrondaemon is executing the commands and thatmetrics-utilityis producing output:cat /var/log/cronFor reference, see the following example output:
May 8 09:45:03 ip-10-0-6-23 CROND[51623]: (root) CMDOUT (No billing data for month: 2024-04) May 8 09:45:03 ip-10-0-6-23 CROND[51623]: (root) CMDEND (metrics-utility build_report) May 8 09:45:19 ip-10-0-6-23 crontab[51619]: (root) END EDIT (root) May 8 09:45:34 ip-10-0-6-23 crontab[51659]: (root) BEGIN EDIT (root) May 8 09:46:01 ip-10-0-6-23 CROND[51688]: (root) CMD (metrics-utility gather_automation_controller_billing_data --ship --until=10m) May 8 09:46:03 ip-10-0-6-23 CROND[51669]: (root) CMDOUT (/tmp/9e3f86ee-c92e-4b05-8217-72c496e6ffd9-2024-05-08-093402+0000-2024-05-08-093602+0000-0.tar.gz) May 8 09:46:03 ip-10-0-6-23 CROND[51669]: (root) CMDEND (metrics-utility gather_automation_controller_billing_data --ship --until=10m) May 8 09:46:26 ip-10-0-6-23 crontab[51659]: (root) END EDIT (root)The generated report will have the default name
CCSP-<YEAR>-<MONTH>.xlsxand is saved in the ship path that you specified in step 1a.
Time and date might vary depending on how your configure the run schedule.
Configure the metrics-utility on OpenShift Container Platform from the Ansible Automation Platform operator Copy linkLink copied!
The metrics-utility is a command-line tool that collects and reports metrics from your OpenShift Container Platform cluster to your automation controller instance.
metrics-utility is included in the OpenShift Container Platform image beginning with version 4.12, 4.512, and 4.6. If your system does not have metrics-utility installed, update your OpenShift image to the latest version.
Complete the following steps to configure the run schedule for metrics-utility on OpenShift Container Platform using the Ansible Automation Platform operator:
Create a ConfigMap in the OpenShift UI YAML view Copy linkLink copied!
Learn how to create a ConfigMap in the OpenShift UI YAML view to inject configuration data for the metrics-utility cronjobs.
Before you begin Copy linkLink copied!
- A running OpenShift cluster
- An operator-based installation of Ansible Automation Platform on OpenShift Container Platform.
metrics-utility runs as indicated by the parameters you set in the configuration file. You cannot run the utility manually on OpenShift Container Platform.
About this task Copy linkLink copied!
To inject the metrics-utility cronjobs with configuration data, and create a ConfigMap in the OpenShift UI YAML view:
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- To verify that the ConfigMap was created and
metrics-utilityis installed, select ConfigMap from the navigation panel and search for your ConfigMap in the list.
Deploy automation controller Copy linkLink copied!
automation controller includes a metrics-utility cronjob that gathers usage information and generates a report at specified intervals.
About this task Copy linkLink copied!
To deploy automation controller and specify variables for how often metrics-utility gathers usage information and generates a report, use the following procedure:
Procedure Copy linkLink copied!
Configure the metrics-utility on a manual containerized installation of Ansible Automation Platform Copy linkLink copied!
The metrics-utility tool generates performance metrics and reports for Ansible Automation Platform installations.
metrics-utility is included in the OpenShift Container Platform image beginning with version 4.12, 4.512, and 4.6. If your system does not have metrics-utility installed, update your OpenShift image to the latest version.
Use the following steps to configure metrics-utility on a manual containerized installation Ansible Automation Platform:
- Enable and configure
metrics-utilityin the inventory file. - Apply your
metrics-utilityconfiguration. - Verify the
systemctltimer. - Verify the data collection.
- Locate the generated reports.
You must have an active Ansible Automation Platform subscription
Minimum resource requirements
Using the metrics-utility tool on a containerized installation of Ansible Automation Platform requires the following resources:
- CPU: 1 dedicated CPU core
- 100% of 1 core used during execution
- Memory:
- Minimum: 256 MB RAM (supports up to ~10,000 job host summaries)
- Recommended: 512 MB RAM (standard deployments)
- Large-scale: 1 GB RAM (supports up to ~100,000 job host summaries)
Note Memory requirements scale with the number of hosts and jobs processed.
- Execution time: Report generation typically completes within 10-30 seconds, depending on data volume
Enable and configure the metrics-utility in the inventory file Copy linkLink copied!
Modify your Ansible Automation Platform inventory file to enable and configure metrics-utility.
Procedure Copy linkLink copied!
Apply your metrics-utility configuration Copy linkLink copied!
If you are running metrics-utility on a new installation, you do not need to take any additional actions to apply your configuration.
About this task Copy linkLink copied!
If you are applying your metrics-utility configuration to an existing deployment, you must re-run the Ansible Automation Platform installer script. Re-running the script reads the updated inventory file, deploys the automation-controller-metrics-utility container, and creates the systemd user services and timers necessary to automate data collection and reporting. Use the following verification steps to ensure your metrics-utility configuration has been applied and is running correctly:
Procedure Copy linkLink copied!
- Verify your
systemctltimer. - Verify data collection.
- Locate generated reports.
Results Copy linkLink copied!
- Run the following command to verify that your
systemctl timerjob entries were saved correctly:systemctl --user list-timers --no-pager | grep metrics-utilityExample output:
Wed 2025-08-13 10:45:00 IST 8min left Wed 2025-08-13 10:30:04 IST 6min ago metrics-utility-build-report.timer metrics-utility-build-report.service Wed 2025-08-13 10:45:00 IST 8min left Wed 2025-08-13 10:30:04 IST 6min ago metrics-utility-gather.timer metrics-utility-gather.service - Use the following command to verify data collection by inspecting the output logs of the services you are running:
systemctl --user status metrics-utility-gather.serviceExample output:
metrics-utility-gather.service - Podman metrics-utility-gather.service Loaded: loaded (/home/aap/.config/systemd/user/metrics-utility-gather.service; disabled; preset: disabled) Active: inactive (dead) since Wed 2025-08-13 10:00:06 IST; 5min ago Duration: 2.008s TriggeredBy: ● metrics-utility-gather.timer Docs: man:podman-generate-systemd(1) Process: 1472847 ExecStart=/usr/bin/podman start metrics-utility-gather (code=exited, status=0/SUCCESS) Process: 1472927 ExecStop=/usr/bin/podman stop -t 10 metrics-utility-gather (code=exited, status=0/SUCCESS) Process: 1472937 ExecStopPost=/usr/bin/podman stop -t 10 metrics-utility-gather (code=exited, status=0/SUCCESS) Main PID: 1472874 (code=exited, status=0/SUCCESS) CPU: 197ms Aug 13 10:00:04 aap.example.org podman[1472847]: metrics-utility-gather Aug 13 10:00:04 aap.example.org systemd[993]: Started Podman metrics-utility-gather.service. Aug 13 10:00:05 aap.example.org metrics-utility-gather[1472874]: 2025-08-13 09:00:05,806 INFO [-] awx.main.analytics /tmp/3292ca44-3314-4f> Aug 13 10:00:05 aap.example.org metrics-utility-gather[1472874]: /tmp/3292ca44-3314-4f0b-b3f6-ba4a1e47a2b1-2025-08-13-083505+0000-2025-08-13-0> Aug 13 10:00:05 aap.example.org metrics-utility-gather[1472874]: 2025-08-13 09:00:05,808 INFO [-] awx.main.analytics /tmp/3292ca44-3314-4f> Aug 13 10:00:05 aap.example.org metrics-utility-gather[1472874]: /tmp/3292ca44-3314-4f0b-b3f6-ba4a1e47a2b1-2025-08-13-083505+0000-2025-08-13-0> Aug 13 10:00:06 aap.example.org podman[1472912]: 2025-08-13 10:00:06.169271763 +0100 IST m=+0.019922418 container died 5dc8d5674f1d1745258530f> Aug 13 10:00:06 aap.example.org podman[1472912]: 2025-08-13 10:00:06.187584135 +0100 IST m=+0.038234790 container cleanup 5dc8d5674f1d17452585> Aug 13 10:00:06 aap.example.org podman[1472927]: metrics-utility-gather Aug 13 10:00:06 aap.example.org podman[1472937]: metrics-utility-gather - Locate the generated reports. Reports are saved in the directory you specified in the
METRICS_UTILITY_SHIP_PATHsetting.- Path: Using the example provided in this document, the report path would be
/aap/controller/data/metrics/. - Filename: The report name follows the format
CCSP-<YEAR>-<MONTH>.xlsx. For example, a report generated for August, 2025 would be namedCCSP-2025-08.xlsx.
- Path: Using the example provided in this document, the report path would be