|
13 | 13 |
|
14 | 14 | build_dispatcher() -> |
15 | 15 | {ok, _} = application:ensure_all_started(prometheus), |
16 | | - prometheus_registry:register_collectors([ |
| 16 | + CoreCollectors = [ |
17 | 17 | prometheus_rabbitmq_core_metrics_collector, |
18 | 18 | prometheus_rabbitmq_global_metrics_collector, |
19 | 19 | prometheus_rabbitmq_message_size_metrics_collector, |
20 | 20 | prometheus_rabbitmq_alarm_metrics_collector, |
21 | 21 | prometheus_rabbitmq_dynamic_collector, |
22 | | - prometheus_process_collector]), |
23 | | - prometheus_registry:register_collectors('per-object', [ |
| 22 | + prometheus_process_collector], |
| 23 | + PerObjectCollectors = CoreCollectors ++ [ |
24 | 24 | prometheus_vm_system_info_collector, |
25 | 25 | prometheus_vm_dist_collector, |
26 | 26 | prometheus_vm_memory_collector, |
27 | 27 | prometheus_mnesia_collector, |
28 | 28 | prometheus_vm_statistics_collector, |
29 | 29 | prometheus_vm_msacc_collector, |
30 | | - prometheus_rabbitmq_core_metrics_collector, |
31 | | - prometheus_rabbitmq_global_metrics_collector, |
32 | | - prometheus_rabbitmq_raft_metrics_collector, |
33 | | - prometheus_rabbitmq_message_size_metrics_collector |
34 | | - ]), |
| 30 | + prometheus_rabbitmq_raft_metrics_collector |
| 31 | + ], |
| 32 | + prometheus_registry:register_collectors( |
| 33 | + case application:get_env(rabbitmq_prometheus, return_per_object_metrics, fasle) of |
| 34 | + false -> CoreCollectors; |
| 35 | + true -> PerObjectCollectors |
| 36 | + end |
| 37 | + ), |
| 38 | + prometheus_registry:register_collectors('per-object', |
| 39 | + CoreCollectors ++ PerObjectCollectors), |
35 | 40 | prometheus_registry:register_collectors('detailed', [ |
36 | 41 | prometheus_rabbitmq_core_metrics_collector |
37 | 42 | ]), |
|
0 commit comments