Class MetricsEndpoint
java.lang.Object
io.micronaut.configuration.metrics.management.endpoint.MetricsEndpoint
@Endpoint(value="metrics",
defaultSensitive=false)
@RequiresMetrics
public class MetricsEndpoint
extends Object
Provides an endpoint to visualize metrics.
- Since:
- 1.0
- Author:
- Christian Oestreich
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA set of tags for further dimensional drilldown and their potential values.static final classResponse payload for a metric name selector.static final classResponse payload for a metric name listing.static final classA measurement sample combining astatisticand a value. -
Constructor Summary
ConstructorsConstructorDescriptionMetricsEndpoint(io.micrometer.core.instrument.MeterRegistry meterRegistry, DataSource[] dataSources) -
Method Summary
Modifier and TypeMethodDescriptiongetMetricDetails(String name, @Nullable List<String> tag) Reads individual metric data.Lists metric names.
-
Constructor Details
-
MetricsEndpoint
public MetricsEndpoint(io.micrometer.core.instrument.MeterRegistry meterRegistry, DataSource[] dataSources) - Parameters:
meterRegistry- The meter registrydataSources- To ensure data sources are loaded
-
-
Method Details
-
listNames
Lists metric names. To get the details, invoke the methodgetMetricDetails(name).- Returns:
- single of HTTP response with metric names
-
getMetricDetails
@Read public MetricsEndpoint.MetricDetails getMetricDetails(@Selector String name, @Nullable @Nullable List<String> tag) Reads individual metric data.After calling the /metrics endpoint, you can pass the name in like /metrics/foo.bar and the details for the metrics and tags will be returned.
Will return a 404 if the metric is not found.
- Parameters:
name- the name of the metric to get the details fortag- The tags- Returns:
- single with metric details response
-