@@ -235,144 +235,32 @@ Dispatcherd is sponsored by [Red Hat, Inc](https://www.redhat.com).
235235
236236## Metrics
237237
238- Start the dispatcher.
238+ You can run a demo of the metrics server. In your first terminal tab, run:
239239
240240```
241- pip install prometheus_client
241+ pip install .[pg_notify,metrics]
242+ dispatcherd
243+ ```
242244
243- $ curl http://localhost:8070
245+ In another tab run:
244246
247+ ```
245248curl http://localhost:8070
249+ ```
250+
251+ This should report metrics in the following general format:
252+
253+ ```
254+ $ curl http://localhost:8070
246255# HELP dispatcher_messages_received_total Number of messages received by dispatchermain
247256# TYPE dispatcher_messages_received_total counter
248- dispatcher_messages_received_total 88 .0
257+ dispatcher_messages_received_total 263 .0
249258# HELP dispatcher_control_messages_count_total Number of control messages received.
250259# TYPE dispatcher_control_messages_count_total counter
251- dispatcher_control_messages_count_total 10.0
252- # HELP dispatcher_worker_created_at Creation time of worker
253- # TYPE dispatcher_worker_created_at gauge
254- dispatcher_worker_created_at{worker_index="0"} 286576.365272104
255- dispatcher_worker_created_at{worker_index="1"} 286576.365368035
256- dispatcher_worker_created_at{worker_index="2"} 286578.814706941
257- dispatcher_worker_created_at{worker_index="3"} 286578.817639637
258- dispatcher_worker_created_at{worker_index="4"} 286578.820265243
259- dispatcher_worker_created_at{worker_index="5"} 286578.822075874
260- dispatcher_worker_created_at{worker_index="6"} 286578.824725725
261- dispatcher_worker_created_at{worker_index="7"} 286578.837810563
262- dispatcher_worker_created_at{worker_index="8"} 286578.844329095
263- dispatcher_worker_created_at{worker_index="9"} 286578.863277972
264- dispatcher_worker_created_at{worker_index="10"} 286578.878555905
265- dispatcher_worker_created_at{worker_index="11"} 286579.36656921
266- # HELP dispatcher_worker_finished_count Finished count of tasks by the worker
267- # TYPE dispatcher_worker_finished_count gauge
268- dispatcher_worker_finished_count{worker_index="0"} 2.0
269- dispatcher_worker_finished_count{worker_index="1"} 1.0
270- dispatcher_worker_finished_count{worker_index="2"} 1.0
271- dispatcher_worker_finished_count{worker_index="3"} 7.0
272- dispatcher_worker_finished_count{worker_index="4"} 8.0
273- dispatcher_worker_finished_count{worker_index="5"} 1.0
274- dispatcher_worker_finished_count{worker_index="6"} 0.0
275- dispatcher_worker_finished_count{worker_index="7"} 0.0
276- dispatcher_worker_finished_count{worker_index="8"} 0.0
277- dispatcher_worker_finished_count{worker_index="9"} 2.0
278- dispatcher_worker_finished_count{worker_index="10"} 1.0
279- dispatcher_worker_finished_count{worker_index="11"} 1.0
280- # HELP dispatcher_worker_status Status of worker.
281- # TYPE dispatcher_worker_status gauge
282- dispatcher_worker_status{dispatcher_worker_status="error",worker_index="0"} 0.0
283- dispatcher_worker_status{dispatcher_worker_status="exited",worker_index="0"} 0.0
284- dispatcher_worker_status{dispatcher_worker_status="initialized",worker_index="0"} 0.0
285- dispatcher_worker_status{dispatcher_worker_status="ready",worker_index="0"} 1.0
286- dispatcher_worker_status{dispatcher_worker_status="retired",worker_index="0"} 0.0
287- dispatcher_worker_status{dispatcher_worker_status="spawned",worker_index="0"} 0.0
288- dispatcher_worker_status{dispatcher_worker_status="starting",worker_index="0"} 0.0
289- dispatcher_worker_status{dispatcher_worker_status="stopping",worker_index="0"} 0.0
290- dispatcher_worker_status{dispatcher_worker_status="error",worker_index="1"} 0.0
291- dispatcher_worker_status{dispatcher_worker_status="exited",worker_index="1"} 0.0
292- dispatcher_worker_status{dispatcher_worker_status="initialized",worker_index="1"} 0.0
293- dispatcher_worker_status{dispatcher_worker_status="ready",worker_index="1"} 1.0
294- dispatcher_worker_status{dispatcher_worker_status="retired",worker_index="1"} 0.0
295- dispatcher_worker_status{dispatcher_worker_status="spawned",worker_index="1"} 0.0
296- dispatcher_worker_status{dispatcher_worker_status="starting",worker_index="1"} 0.0
297- dispatcher_worker_status{dispatcher_worker_status="stopping",worker_index="1"} 0.0
298- dispatcher_worker_status{dispatcher_worker_status="error",worker_index="2"} 0.0
299- dispatcher_worker_status{dispatcher_worker_status="exited",worker_index="2"} 0.0
300- dispatcher_worker_status{dispatcher_worker_status="initialized",worker_index="2"} 0.0
301- dispatcher_worker_status{dispatcher_worker_status="ready",worker_index="2"} 1.0
302- dispatcher_worker_status{dispatcher_worker_status="retired",worker_index="2"} 0.0
303- dispatcher_worker_status{dispatcher_worker_status="spawned",worker_index="2"} 0.0
304- dispatcher_worker_status{dispatcher_worker_status="starting",worker_index="2"} 0.0
305- dispatcher_worker_status{dispatcher_worker_status="stopping",worker_index="2"} 0.0
306- dispatcher_worker_status{dispatcher_worker_status="error",worker_index="3"} 0.0
307- dispatcher_worker_status{dispatcher_worker_status="exited",worker_index="3"} 0.0
308- dispatcher_worker_status{dispatcher_worker_status="initialized",worker_index="3"} 0.0
309- dispatcher_worker_status{dispatcher_worker_status="ready",worker_index="3"} 1.0
310- dispatcher_worker_status{dispatcher_worker_status="retired",worker_index="3"} 0.0
311- dispatcher_worker_status{dispatcher_worker_status="spawned",worker_index="3"} 0.0
312- dispatcher_worker_status{dispatcher_worker_status="starting",worker_index="3"} 0.0
313- dispatcher_worker_status{dispatcher_worker_status="stopping",worker_index="3"} 0.0
314- dispatcher_worker_status{dispatcher_worker_status="error",worker_index="4"} 0.0
315- dispatcher_worker_status{dispatcher_worker_status="exited",worker_index="4"} 0.0
316- dispatcher_worker_status{dispatcher_worker_status="initialized",worker_index="4"} 0.0
317- dispatcher_worker_status{dispatcher_worker_status="ready",worker_index="4"} 1.0
318- dispatcher_worker_status{dispatcher_worker_status="retired",worker_index="4"} 0.0
319- dispatcher_worker_status{dispatcher_worker_status="spawned",worker_index="4"} 0.0
320- dispatcher_worker_status{dispatcher_worker_status="starting",worker_index="4"} 0.0
321- dispatcher_worker_status{dispatcher_worker_status="stopping",worker_index="4"} 0.0
322- dispatcher_worker_status{dispatcher_worker_status="error",worker_index="5"} 0.0
323- dispatcher_worker_status{dispatcher_worker_status="exited",worker_index="5"} 0.0
324- dispatcher_worker_status{dispatcher_worker_status="initialized",worker_index="5"} 0.0
325- dispatcher_worker_status{dispatcher_worker_status="ready",worker_index="5"} 1.0
326- dispatcher_worker_status{dispatcher_worker_status="retired",worker_index="5"} 0.0
327- dispatcher_worker_status{dispatcher_worker_status="spawned",worker_index="5"} 0.0
328- dispatcher_worker_status{dispatcher_worker_status="starting",worker_index="5"} 0.0
329- dispatcher_worker_status{dispatcher_worker_status="stopping",worker_index="5"} 0.0
330- dispatcher_worker_status{dispatcher_worker_status="error",worker_index="6"} 0.0
331- dispatcher_worker_status{dispatcher_worker_status="exited",worker_index="6"} 0.0
332- dispatcher_worker_status{dispatcher_worker_status="initialized",worker_index="6"} 0.0
333- dispatcher_worker_status{dispatcher_worker_status="ready",worker_index="6"} 1.0
334- dispatcher_worker_status{dispatcher_worker_status="retired",worker_index="6"} 0.0
335- dispatcher_worker_status{dispatcher_worker_status="spawned",worker_index="6"} 0.0
336- dispatcher_worker_status{dispatcher_worker_status="starting",worker_index="6"} 0.0
337- dispatcher_worker_status{dispatcher_worker_status="stopping",worker_index="6"} 0.0
338- dispatcher_worker_status{dispatcher_worker_status="error",worker_index="7"} 0.0
339- dispatcher_worker_status{dispatcher_worker_status="exited",worker_index="7"} 0.0
340- dispatcher_worker_status{dispatcher_worker_status="initialized",worker_index="7"} 0.0
341- dispatcher_worker_status{dispatcher_worker_status="ready",worker_index="7"} 1.0
342- dispatcher_worker_status{dispatcher_worker_status="retired",worker_index="7"} 0.0
343- dispatcher_worker_status{dispatcher_worker_status="spawned",worker_index="7"} 0.0
344- dispatcher_worker_status{dispatcher_worker_status="starting",worker_index="7"} 0.0
345- dispatcher_worker_status{dispatcher_worker_status="stopping",worker_index="7"} 0.0
346- dispatcher_worker_status{dispatcher_worker_status="error",worker_index="8"} 0.0
347- dispatcher_worker_status{dispatcher_worker_status="exited",worker_index="8"} 0.0
348- dispatcher_worker_status{dispatcher_worker_status="initialized",worker_index="8"} 0.0
349- dispatcher_worker_status{dispatcher_worker_status="ready",worker_index="8"} 1.0
350- dispatcher_worker_status{dispatcher_worker_status="retired",worker_index="8"} 0.0
351- dispatcher_worker_status{dispatcher_worker_status="spawned",worker_index="8"} 0.0
352- dispatcher_worker_status{dispatcher_worker_status="starting",worker_index="8"} 0.0
353- dispatcher_worker_status{dispatcher_worker_status="stopping",worker_index="8"} 0.0
354- dispatcher_worker_status{dispatcher_worker_status="error",worker_index="9"} 0.0
355- dispatcher_worker_status{dispatcher_worker_status="exited",worker_index="9"} 0.0
356- dispatcher_worker_status{dispatcher_worker_status="initialized",worker_index="9"} 0.0
357- dispatcher_worker_status{dispatcher_worker_status="ready",worker_index="9"} 1.0
358- dispatcher_worker_status{dispatcher_worker_status="retired",worker_index="9"} 0.0
359- dispatcher_worker_status{dispatcher_worker_status="spawned",worker_index="9"} 0.0
360- dispatcher_worker_status{dispatcher_worker_status="starting",worker_index="9"} 0.0
361- dispatcher_worker_status{dispatcher_worker_status="stopping",worker_index="9"} 0.0
362- dispatcher_worker_status{dispatcher_worker_status="error",worker_index="10"} 0.0
363- dispatcher_worker_status{dispatcher_worker_status="exited",worker_index="10"} 0.0
364- dispatcher_worker_status{dispatcher_worker_status="initialized",worker_index="10"} 0.0
365- dispatcher_worker_status{dispatcher_worker_status="ready",worker_index="10"} 1.0
366- dispatcher_worker_status{dispatcher_worker_status="retired",worker_index="10"} 0.0
367- dispatcher_worker_status{dispatcher_worker_status="spawned",worker_index="10"} 0.0
368- dispatcher_worker_status{dispatcher_worker_status="starting",worker_index="10"} 0.0
369- dispatcher_worker_status{dispatcher_worker_status="stopping",worker_index="10"} 0.0
370- dispatcher_worker_status{dispatcher_worker_status="error",worker_index="11"} 0.0
371- dispatcher_worker_status{dispatcher_worker_status="exited",worker_index="11"} 0.0
372- dispatcher_worker_status{dispatcher_worker_status="initialized",worker_index="11"} 0.0
373- dispatcher_worker_status{dispatcher_worker_status="ready",worker_index="11"} 1.0
374- dispatcher_worker_status{dispatcher_worker_status="retired",worker_index="11"} 0.0
375- dispatcher_worker_status{dispatcher_worker_status="spawned",worker_index="11"} 0.0
376- dispatcher_worker_status{dispatcher_worker_status="starting",worker_index="11"} 0.0
377- dispatcher_worker_status{dispatcher_worker_status="stopping",worker_index="11"} 0.0
260+ dispatcher_control_messages_count_total 0.0
261+ # HELP dispatcher_worker_count_total Number of workers running.
262+ # TYPE dispatcher_worker_count_total counter
263+ dispatcher_worker_count_total 3.0
378264```
265+
266+ We expect to add more metrics in the future.
0 commit comments