Skip to content

Commit

Permalink
add license expiry metric
Browse files Browse the repository at this point in the history
  • Loading branch information
neevnuv committed Sep 10, 2024
1 parent 011733a commit bc0c3f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions awx/main/analytics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def metrics():
registry=REGISTRY,
)

LICENSE_EXPIRY = Gauge('awx_license_expiry', 'Time before AWX 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_FREE = Gauge('awx_license_instance_free', 'Number of remaining managed hosts provided by your license', registry=REGISTRY)

Expand All @@ -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_FREE.set(str(license_info.get('free_instances', 0)))

Expand Down

0 comments on commit bc0c3f6

Please sign in to comment.