mirror of
https://github.com/ansible/awx.git
synced 2026-02-20 20:50:06 -03:30
Add License Expiry Metric (#15483)
* add license expiry metric * Update metrics test with default value to the new license metrics * Add the changes of the black-lint command * Update awx/main/analytics/metrics.py --------- Co-authored-by: Seth Foster <fosterseth@users.noreply.github.com>
This commit is contained in:
@@ -128,6 +128,7 @@ def metrics():
|
|||||||
registry=REGISTRY,
|
registry=REGISTRY,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
LICENSE_EXPIRY = Gauge('awx_license_expiry', 'Time before license expires', registry=REGISTRY)
|
||||||
LICENSE_INSTANCE_TOTAL = Gauge('awx_license_instance_total', 'Total number of managed hosts provided by your license', registry=REGISTRY)
|
LICENSE_INSTANCE_TOTAL = Gauge('awx_license_instance_total', 'Total number of managed hosts provided by your license', registry=REGISTRY)
|
||||||
LICENSE_INSTANCE_FREE = Gauge('awx_license_instance_free', 'Number of remaining managed hosts provided by your license', registry=REGISTRY)
|
LICENSE_INSTANCE_FREE = Gauge('awx_license_instance_free', 'Number of remaining managed hosts provided by your license', registry=REGISTRY)
|
||||||
|
|
||||||
@@ -148,6 +149,7 @@ def metrics():
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
LICENSE_EXPIRY.set(str(license_info.get('time_remaining', 0)))
|
||||||
LICENSE_INSTANCE_TOTAL.set(str(license_info.get('instance_count', 0)))
|
LICENSE_INSTANCE_TOTAL.set(str(license_info.get('instance_count', 0)))
|
||||||
LICENSE_INSTANCE_FREE.set(str(license_info.get('free_instances', 0)))
|
LICENSE_INSTANCE_FREE.set(str(license_info.get('free_instances', 0)))
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ EXPECTED_VALUES = {
|
|||||||
'awx_license_instance_free': 0,
|
'awx_license_instance_free': 0,
|
||||||
'awx_pending_jobs_total': 0,
|
'awx_pending_jobs_total': 0,
|
||||||
'awx_database_connections_total': 1,
|
'awx_database_connections_total': 1,
|
||||||
|
'awx_license_expiry': 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user