mirror of
https://github.com/ansible/awx.git
synced 2026-02-12 07:04:45 -03:30
- Adds a Metrics() class that can track data such as number of events the callback receiver inserted into database - Exposes this metric data at the api/v2/metrics/ endpoint. This data is prometheus-friendly - Metric data is stored in memory, then periodically saved to Redis. - Metric data is periodically broadcast to other nodes in the cluster, so that each node has a copy of the most recent metric data collected.
15 lines
325 B
Python
15 lines
325 B
Python
# Python
|
|
import logging
|
|
|
|
# AWX
|
|
from awx.main.analytics.subsystem_metrics import Metrics
|
|
from awx.main.dispatch.publish import task
|
|
from awx.main.dispatch import get_local_queuename
|
|
|
|
logger = logging.getLogger('awx.main.scheduler')
|
|
|
|
|
|
@task(queue=get_local_queuename)
|
|
def send_subsystem_metrics():
|
|
Metrics().send_metrics()
|