mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
always display awx_status_total
this way we don't have null data in monitoring data this makes writing alerts and dashboards easier
This commit is contained in:
parent
5b5aac675b
commit
710b02a443
@ -3,6 +3,7 @@ from prometheus_client import CollectorRegistry, Gauge, Info, generate_latest
|
||||
|
||||
from awx.conf.license import get_license
|
||||
from awx.main.utils import get_awx_version
|
||||
from awx.main.models import UnifiedJob
|
||||
from awx.main.analytics.collectors import (
|
||||
counts,
|
||||
instance_info,
|
||||
@ -169,8 +170,9 @@ def metrics():
|
||||
|
||||
all_job_data = job_counts(None)
|
||||
statuses = all_job_data.get('status', {})
|
||||
for status, value in statuses.items():
|
||||
STATUS.labels(status=status).set(value)
|
||||
states = set(dict(UnifiedJob.STATUS_CHOICES).keys()) - set(['new'])
|
||||
for state in states:
|
||||
STATUS.labels(status=state).set(statuses.get(state, 0))
|
||||
|
||||
RUNNING_JOBS.set(current_counts['running_jobs'])
|
||||
PENDING_JOBS.set(current_counts['pending_jobs'])
|
||||
|
||||
@ -19,8 +19,7 @@ EXPECTED_VALUES = {
|
||||
'awx_hosts_total': 1.0,
|
||||
'awx_schedules_total': 1.0,
|
||||
'awx_sessions_total': 0.0,
|
||||
'awx_sessions_total': 0.0,
|
||||
'awx_sessions_total': 0.0,
|
||||
'awx_status_total': 0.0,
|
||||
'awx_running_jobs_total': 0.0,
|
||||
'awx_instance_capacity': 100.0,
|
||||
'awx_instance_consumed_capacity': 0.0,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user