OpenTelemetry Metrics
Metrics are quantitative measurements of an application, captured and aggregated at runtime in regular time intervals. This page describes how to configure the metrics support in OpenTelemetry.
Learn more about metrics in the OpenTelemetry documentation. |
Enabling/Disabling Metrics
Support for OpenTelemetry Metrics is enabled by default. You can disable it via configuration properties.
arconia:
otel:
metrics:
enabled: false
Configuration Properties
You can configure the support for OpenTelemetry Metrics via configuration properties.
Property |
Default |
Description |
|
|
Maximum number of distinct points per metric. |
|
|
Whether exemplars should be enabled. |
|
|
Determines which measurements are eligible to become Exemplars. Options: |
OpenTelemetry Environment Variables
Arconia supports the OpenTelemetry Environment Variable Specification for configuring the OpenTelemetry integration. If both the OpenTelemetry Environment Variables and the Arconia configuration properties are set, the OpenTelemetry Environment Variables will take precedence.
This support is especially useful during deployment, where you can use the same set of standard environment variables to configure OpenTelemetry Logs across different languages and frameworks.
You can disable this support by setting the arconia.otel.compatibility.environment-variable-specification
configuration property to false
.
Programmatic Configuration
You can further customize the auto-configured SdkMeterProvider
instance via the OpenTelemetryMeterProviderBuilderCustomizer
API.
@FunctionalInterface
public interface OpenTelemetryMeterProviderBuilderCustomizer {
void customize(SdkMeterProviderBuilder builder);
}
Disabling the Auto-Configuration
The auto-configuration provided by Arconia for OpenTelemetry Metrics is enabled by default, but you can disable it as explained in the Enabling/Disabling Metrics section.
If you define a custom SdkMeterProvider
bean, the auto-configuration will back off, and your custom bean will be used instead.
@Configuration(proxyBeanMethods = false)
public class MyMetricsConfiguration {
@Bean
public SdkMeterProvider myMeterProvider() {
...
}
}
Exporting Metrics
By default, metrics are enabled and exported via OTLP, but you can change the type of exporter globally or specifically for metrics. If you set the exporter type to none
, the corresponding signal will be disabled from exporting.
If a value is not provided specifically for metrics, the value configured for the general exporter is used, if available. |
Property |
Default |
Description |
|
|
The type of OpenTelemetry exporter to use for observability signals. Options: |
|
|
The interval between two consecutive exports of metrics. |
|
`` |
The type of OpenTelemetry exporter to use for metrics. Options: |
|
|
The aggregation temporality to use for exporting metrics. Options: |
|
|
The aggregation strategy to use for exporting histograms. Options: |
For more information on exporting metrics to the console, refer to Console Exporter. |
OTLP
When metrics are exported via OTLP (default behavior), you can configure the following properties.
If a value is not provided specifically for metrics, the value configured for the general OTLP export is used, if available. See OTLP. |
Property |
Default |
Description |
|
|
Compression type to use for OTLP requests. Options: |
|
|
The maximum waiting time for the exporter to establish a connection to the endpoint. |
|
|
The endpoint to which telemetry data will be sent. |
|
- |
Additional headers to include in each request to the endpoint. |
|
|
Whether to generate metrics for the exporter itself. |
|
|
Transport protocol to use for OTLP requests. Options: |
|
|
The maximum waiting time for the exporter to send each telemetry batch. |
The default OTLP exporter uses HTTP/Protobuf. If you’d like to use gRPC, refer to OTLP gRPC. |
Micrometer Metrics Bridge
Spring libraries and many other libraries from the Java ecosystem are instrumented using Micrometer Metrics. Arconia supports bridges to export Micrometer Metrics to OpenTelemetry.
Micrometer Metrics OpenTelemetry Bridge (from OpenTelemetry Java Instrumentation)
The Arconia OpenTelemetry Spring Boot Starter comes built-in with the Micrometer Metrics OpenTelemetry Bridge provided by the OpenTelemetry Java Instrumentation for Micrometer, which is based on the OpenTelemetry API and integrates fully with the OpenTelemetry SDK.
The Micrometer Metrics OpenTelemetry Bridge from the OpenTelemetry Java Instrumentation project is still experimental. |
The OpenTelemetryMeterRegistry bean registered by this bridge doesn’t support reading metrics, but only bridging them to OpenTelemetry. For that reason, an additional SimpleMeterRegistry bean is registered for reading Micrometer metrics, an operation typically performed by the Spring Boot Actuator library.
|
Enabling/Disabling the Bridge
The Micrometer Metrics OpenTelemetry Bridge can be disabled via configuration properties.
arconia.otel.metrics.micrometer-bridge.enabled: false
Alternatively, you can exclude the io.arconia:arconia-opentelemetry-micrometer-metrics-bridge
dependency from your project, which will disable the bridge entirely.
-
Gradle
-
Maven
dependencies {
implementation("io.arconia:arconia-opentelemetry-spring-boot-starter") {
exclude group: "io.arconia", module: "arconia-opentelemetry-micrometer-metrics-bridge"
}
}
<dependency>
<groupId>io.arconia</groupId>
<artifactId>arconia-opentelemetry-spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>io.arconia</groupId>
<artifactId>arconia-opentelemetry-micrometer-metrics-bridge</artifactId>
</exclusion>
</exclusions>
</dependency>
Configuration Properties
The Micrometer Metrics OpenTelemetry Bridge can be configured via configuration properties.
Property |
Default |
Description |
|
|
The base time unit for Micrometer metrics. |
|
|
Whether to generate gauge-based Micrometer histograms. |