Skip to content

Commit

Permalink
only send the aggregate metric, instead of per worker
Browse files Browse the repository at this point in the history
  • Loading branch information
zemek committed Apr 10, 2023
1 parent a4fc7c9 commit d1f6b0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flower/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_prometheus_metrics():
class PrometheusMetrics(object):

def __init__(self):
self.events = PrometheusCounter('flower_events_total', "Number of events", ['worker', 'type', 'task'])
self.events = PrometheusCounter('flower_events_total', "Number of events", ['type', 'task'])

self.runtime = Histogram(
'flower_task_runtime_seconds',
Expand Down Expand Up @@ -85,7 +85,8 @@ def event(self, event):
task_name = event.get('name', '')
if not task_name and task_id in self.tasks:
task_name = task.name or ''
self.metrics.events.labels(worker_name, event_type, task_name).inc()

self.metrics.events.labels(event_type, task_name).inc()

runtime = event.get('runtime', 0)
if runtime:
Expand Down

1 comment on commit d1f6b0c

@zemek
Copy link
Author

@zemek zemek commented on d1f6b0c Apr 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed until something like mher#1135 is merged

Please sign in to comment.