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
  • Constructor Details

    • MetricsEndpoint

      public MetricsEndpoint(io.micrometer.core.instrument.MeterRegistry meterRegistry, DataSource[] dataSources)
      Parameters:
      meterRegistry - The meter registry
      dataSources - To ensure data sources are loaded
  • Method Details

    • listNames

      @Read public MetricsEndpoint.MetricNames listNames()
      Lists metric names. To get the details, invoke the method getMetricDetails(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 for
      tag - The tags
      Returns:
      single with metric details response