Change per-object endpoint to `/metrics/per-object`.

This conforms with other http endpoints.
This commit is contained in:
Mirah Gary 2020-11-26 10:35:26 +01:00
parent 37486d45a4
commit fe9881687c
No known key found for this signature in database
GPG Key ID: E16CAD8A99DF220D
5 changed files with 6 additions and 6 deletions

View File

@ -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).
This can be done by scraping the `/metrics/per_object` endpoint:
This can be done by scraping the `/metrics/per-object` endpoint:
```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,

View File

@ -221,7 +221,7 @@ register() ->
deregister_cleanup(_) -> ok.
collect_mf(per_object, Callback) ->
collect_mf('per-object', Callback) ->
collect(true, Callback);
collect_mf(_Registry, Callback) ->
PerObjectMetrics = application:get_env(rabbitmq_prometheus, return_per_object_metrics, false),

View File

@ -14,7 +14,7 @@
build_dispatcher() ->
{ok, _} = application:ensure_all_started(prometheus),
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_dist_collector,
prometheus_vm_memory_collector,

View File

@ -32,7 +32,7 @@ is_authorized(ReqData, Context) ->
setup() ->
setup_metrics(telemetry_registry()),
setup_metrics(per_object).
setup_metrics('per-object').
setup_metrics(Registry) ->
ScrapeDuration = [{name, ?SCRAPE_DURATION},

View File

@ -226,7 +226,7 @@ aggregated_metrics_test(Config) ->
?assertEqual(match, re:run(Body, "^rabbitmq_raft_entry_commit_latency_seconds ", [{capture, none}, multiline])).
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) ->
per_object_metrics_test(Config, "/metrics").