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
Modifier and TypeClassDescriptionstatic final class
A set of tags for further dimensional drilldown and their potential values.static final class
Response payload for a metric name selector.static final class
Response payload for a metric name listing.static final class
A measurement sample combining astatistic
and a value. -
Constructor Summary
ConstructorDescriptionMetricsEndpoint
(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
-