You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running the flower app with persistent and db options to save the task statues to the file flower.db. When i try to open this shelve file and print the keys present in it, i only get one key events. When i try to access the value of db[events], i get the following error in Prometheus client, AttributeError: Unrecognized option 'task-runtime-metric-buckets'
How i start the flower app :- celery -A project --broker=broker_url flower --port=5555 --persistent=True --db=flower_db.db
The code i used to read from the shelve file :-
import shelve
with shelve.open("flower_db.db", 'r') as db:
keys = db.keys()
# the for loop below prints `events`
for key in keys:
print(key)
# this print statement errors out
print(db['events'])
This is the full trace of the error :-
File ~/opt/anaconda3/lib/python3.10/site-packages/flower/events.py:72, in EventsState.__init__(self, *args, **kwargs)
70 super(EventsState, self).__init__(*args, **kwargs)
71 self.counter = collections.defaultdict(Counter)
---> 72 self.metrics = get_prometheus_metrics()
File ~/opt/anaconda3/lib/python3.10/site-packages/flower/events.py:31, in get_prometheus_metrics()
29 global prometheus_metrics
30 if prometheus_metrics is None:
---> 31 prometheus_metrics = PrometheusMetrics()
33 return prometheus_metrics
File ~/opt/anaconda3/lib/python3.10/site-packages/flower/events.py:46, in PrometheusMetrics.__init__(self)
39 self.events = PrometheusCounter('flower_events_total', "Number of events", ['worker', 'type', 'task'])
42 self.runtime = Histogram(
43 'flower_task_runtime_seconds',
44 "Task runtime",
45 ['worker', 'task'],
---> 46 buckets=options.task_runtime_metric_buckets
47 )
48 self.prefetch_time = Gauge(
49 'flower_task_prefetch_time_seconds',
50 "The time the task spent waiting at the celery worker to be executed.",
51 ['worker', 'task']
52 )
53 self.number_of_prefetched_tasks = Gauge(
54 'flower_worker_prefetched_tasks',
55 'Number of tasks of given type prefetched at a worker',
56 ['worker', 'task']
57 )
File ~/opt/anaconda3/lib/python3.10/site-packages/tornado/options.py:158, in OptionParser.__getattr__(self, name)
156 if isinstance(self._options.get(name), _Option):
157 return self._options[name].value()
--> 158 raise AttributeError("Unrecognized option %r" % name)
AttributeError: Unrecognized option 'task-runtime-metric-buckets'
To Reproduce
Steps to reproduce the behavior:
Run flower app with persistent and db settings
Read the shelve file specified in db settings in python
Print the value of the key events
Expected behavior db[events] should print the list of events that flower collected
I'm running the flower app with
persistent
anddb
options to save the task statues to the fileflower.db
. When i try to open this shelve file and print the keys present in it, i only get one keyevents
. When i try to access the value ofdb[events]
, i get the following error in Prometheus client, AttributeError: Unrecognized option 'task-runtime-metric-buckets'How i start the flower app :-
celery -A project --broker=broker_url flower --port=5555 --persistent=True --db=flower_db.db
The code i used to read from the shelve file :-
This is the full trace of the error :-
To Reproduce
Steps to reproduce the behavior:
persistent
anddb
settingsdb
settings in pythonevents
Expected behavior
db[events]
should print the list of events that flower collectedSystem information
The text was updated successfully, but these errors were encountered: