Change per-object endpoint to `/metrics/per-object`.
This conforms with other http endpoints.
This commit is contained in:
parent
37486d45a4
commit
fe9881687c
|
|
@ -67,9 +67,9 @@ In order to not put unnecessary pressure on your metrics system, metrics are agg
|
||||||
|
|
||||||
When debugging, it may be useful to return metrics per object (unaggregated).
|
When debugging, it may be useful to return metrics per object (unaggregated).
|
||||||
|
|
||||||
This can be done by scraping the `/metrics/per_object` endpoint:
|
This can be done by scraping the `/metrics/per-object` endpoint:
|
||||||
```shell
|
```shell
|
||||||
curl -v -H "Accept:text/plain" "http://localhost:15692/metrics/per_object"
|
curl -v -H "Accept:text/plain" "http://localhost:15692/metrics/per-object"
|
||||||
```
|
```
|
||||||
|
|
||||||
This can also be enabled as the default behavior of the `/metrics` endpoint on-the-fly,
|
This can also be enabled as the default behavior of the `/metrics` endpoint on-the-fly,
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,7 @@ register() ->
|
||||||
|
|
||||||
deregister_cleanup(_) -> ok.
|
deregister_cleanup(_) -> ok.
|
||||||
|
|
||||||
collect_mf(per_object, Callback) ->
|
collect_mf('per-object', Callback) ->
|
||||||
collect(true, Callback);
|
collect(true, Callback);
|
||||||
collect_mf(_Registry, Callback) ->
|
collect_mf(_Registry, Callback) ->
|
||||||
PerObjectMetrics = application:get_env(rabbitmq_prometheus, return_per_object_metrics, false),
|
PerObjectMetrics = application:get_env(rabbitmq_prometheus, return_per_object_metrics, false),
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
build_dispatcher() ->
|
build_dispatcher() ->
|
||||||
{ok, _} = application:ensure_all_started(prometheus),
|
{ok, _} = application:ensure_all_started(prometheus),
|
||||||
prometheus_registry:register_collectors([prometheus_rabbitmq_core_metrics_collector]),
|
prometheus_registry:register_collectors([prometheus_rabbitmq_core_metrics_collector]),
|
||||||
prometheus_registry:register_collectors(per_object, [
|
prometheus_registry:register_collectors('per-object', [
|
||||||
prometheus_vm_system_info_collector,
|
prometheus_vm_system_info_collector,
|
||||||
prometheus_vm_dist_collector,
|
prometheus_vm_dist_collector,
|
||||||
prometheus_vm_memory_collector,
|
prometheus_vm_memory_collector,
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ is_authorized(ReqData, Context) ->
|
||||||
|
|
||||||
setup() ->
|
setup() ->
|
||||||
setup_metrics(telemetry_registry()),
|
setup_metrics(telemetry_registry()),
|
||||||
setup_metrics(per_object).
|
setup_metrics('per-object').
|
||||||
|
|
||||||
setup_metrics(Registry) ->
|
setup_metrics(Registry) ->
|
||||||
ScrapeDuration = [{name, ?SCRAPE_DURATION},
|
ScrapeDuration = [{name, ?SCRAPE_DURATION},
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ aggregated_metrics_test(Config) ->
|
||||||
?assertEqual(match, re:run(Body, "^rabbitmq_raft_entry_commit_latency_seconds ", [{capture, none}, multiline])).
|
?assertEqual(match, re:run(Body, "^rabbitmq_raft_entry_commit_latency_seconds ", [{capture, none}, multiline])).
|
||||||
|
|
||||||
endpoint_per_object_metrics(Config) ->
|
endpoint_per_object_metrics(Config) ->
|
||||||
per_object_metrics_test(Config, "/metrics/per_object").
|
per_object_metrics_test(Config, "/metrics/per-object").
|
||||||
|
|
||||||
globally_configure_per_object_metrics_test(Config) ->
|
globally_configure_per_object_metrics_test(Config) ->
|
||||||
per_object_metrics_test(Config, "/metrics").
|
per_object_metrics_test(Config, "/metrics").
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue