Monitoring Micrometer

After you install the Instana host agent, the Micrometer sensor is automatically installed and enabled. You can view metrics that are related to Micrometer in the Instana UI.

Support information

To make sure that the Micrometer sensor is compatible with your current setup, check the following support information sections:

Supported versions

Confirmed support for custom metrics for 1.0.0x.

Sensor (Data Collection)

The micrometer is a simple application metrics facade for the JVM. It is the defacto standard in the Java ecosystem and is integrated into SpringBoot. For more information, see Micrometer.

Instana supports Micrometer without any additional configuration. The sensor detects Micrometer usage and automatically collects metrics. No additional Maven dependency needed.

A Micrometer MeterRegistry is only discovered when a public method is called on the MeterRegistry object once the JVM is instrumented. When you initialize a metric registry by using a public constructor, then only public method executed before the Instana agent begins. Therefore, when any MeterRegistry's public method is called after the agent is started, the agent discovers the registry.

All metric graphs are displayed on the JVM dashboard.

Viewing metrics

To view the metrics, complete the following steps:

  1. In the sidebar of the Instana UI, select Infrastructure.
  2. Click a specific monitored host to view the host dashboard with all the collected metrics and monitored processes.

Configuration data

If the JVM has the Micrometer metrics library loaded, custom metrics are automatically collected and displayed after the JVM dashboard. To prevent the backend from overloading, a default limit of 200 metrics per JVM is set. You can use the tagExtractionMetricPatterns parameter to extract tags for certain metrics. You can provide a list of regular expressions to filter metrics for tag extraction. Tags are extracted only from metrics that match the specified patterns, which are tagExtractionMetricPatterns. If you extract tags from a large number of metrics, then the data ingestion volume might increase.

To disable Micrometer monitoring or to change the limit of metrics, use the following configuration:

com.instana.plugin.java:
  micrometerMetricCollection:
    enabled: false
    limit: 200
    tagExtractionMetricPatterns:
      - '^my_metric'
      - 'abc+'
 

If the metrics are not displayed after the library is loaded, register your io.micrometer.core.instrument.MeterRegistry instance as the default one. For example:

import io.micrometer.core.instrument.Metrics;

Metrics.globalRegistry.add(meterRegistry)
 

Metrics

The following table outlines the sensor that collects all types of metrics:

Metric type Description
Counter The cumulative count since this counter was created
DistributionSummary The total amount of all recorded events
FunctionCounter The cumulative count since this counter was created
FunctionTimer The total time of all occurrences of the timed event
Gauge The current value
LongTaskTimer The current number of tasks being executed
Timer The total time of recorded events scaled to milliseconds
TimeGauge The current value, scaled to the appropriate base unit

For more information, see Micrometer metrics.

The following example shows the metric names that contain concatenated tags when tags are not extracted:

exception=None, method=GET, outcome=SUCCESS, 
status=200, version=1.0, maintainer=instana
 
Figure 1. Metric types of Micrometer
Timer metric

The following example shows the metric names when tags are extracted:

{action="hello",name="fabian",}
 
Figure 2. Metric types of Micrometer
Timer metric

Metric that begins with "jvm", "process", "tomcat", "system", "logback" are automatically excluded from monitoring.