Skip to content

4.x Support OpenTelemetry metrics semantic conventions (server); allow selection of which endpoints collected for OTel, REST.request, and KPI metrics#11057

Closed
tjquinno wants to merge 31 commits intohelidon-io:mainfrom
tjquinno:4.x-otel-metrics-semconv
Closed

4.x Support OpenTelemetry metrics semantic conventions (server); allow selection of which endpoints collected for OTel, REST.request, and KPI metrics#11057
tjquinno wants to merge 31 commits intohelidon-io:mainfrom
tjquinno:4.x-otel-metrics-semconv

Conversation

@tjquinno
Copy link
Member

@tjquinno tjquinno commented Jan 22, 2026

Description

Resolves #11042
Resolves #11123

DRAFT - depends on #11044

Release Note


Selecting which requests are automatically measured

Helidon can automatically collect metrics for REST endpoint traffic:

  • the automatic KPI metrics (simple counter of all requests or extended KPI metrics fi configured)
  • the Helidon MP REST.request timers
  • metrics prescribed by OpenTelemetry semantic conventions for HTTP server traffic (new feature - see below)

You can now control which REST endpoints are measured by adding configuration under server.features.observe.observer.metrics.auto to control which sockets are included in the measurements and which paths are enabled or disabled. This is very similar to the approach taken to configure selective tracing of REST endpoints.

The updated metrics doc pages describe this new feature in detail.

Collecting metrics from OpenTelemetry metrics semantic conventions

Users can now enable OpenTelemetry semantic conventions for metrics which measure incoming HTTP traffic by adding a dependency on the new io.helidon.webserver.observe:helidon-webserver-observe-telemetry-metrics component.

NOTE: Do not try to use OpenTelemetry semantic conventions for metrics with MicroProfile Metrics. The OpenTelemetry semantic conventions prescribe tag names which contain dots (".") which are illegal in MP Metrics tag names. MP Metrics rejects the attempt to register the OpenTelemetry semantic conventions metrics at runtime.

You can control which endpoints Helidon includes using the selection feature described just above.

The updated Helidon SE and MP metrics documentation pages describe both of these new features.


PR Overview

The existing metrics observer component now has a new SPI contract for providers of an HTTP filter that implements automatic HTTP metrics.

The metrics observer code finds all instances of the provider contract and invokes their filter method, passing the metrics observer configuration. By default, the provided filters are added for each socket; config can select which sockets should be so filtered.

The PR also contains a new component has an implementation of this provider contract.

This implementation registers and updates metrics in compliance with the OTel metrics HTTP semantic conventions. The code uses the existing Helidon neutral metrics API to register and update the meters. That means the timers are available via the metrics endpoint and programmatic access to the meter registry. Once #11043 is complete these metrics will be available via OTLP.

Existing code already implements some "legacy" HTTP traffic metrics (KPI metrics, either basic or extended). This PR also applies the new path selections added to the metrics observer config to those legacy metrics. If the user omits the auto

Documentation

Doc update included.

@tjquinno tjquinno self-assigned this Jan 22, 2026
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 22, 2026
@tjquinno tjquinno marked this pull request as draft January 22, 2026 23:13
@tjquinno tjquinno changed the title 4.x Support OpenTelemetry metrics semantic conventions 4.x Support OpenTelemetry metrics semantic conventions (server) Jan 23, 2026
@tjquinno tjquinno force-pushed the 4.x-otel-metrics-semconv branch 2 times, most recently from 8115670 to 024f980 Compare January 28, 2026 23:04
@tjquinno tjquinno force-pushed the 4.x-otel-metrics-semconv branch 3 times, most recently from f2f40a3 to 25fa938 Compare February 13, 2026 00:24
…configuration

# Conflicts:
#	telemetry/opentelemetry-config/pom.xml
#	telemetry/opentelemetry-config/src/main/java/io/helidon/telemetry/otelconfig/Base2ExponentialHistogramAggregationConfigBlueprint.java
#	telemetry/opentelemetry-config/src/main/java/io/helidon/telemetry/otelconfig/ExplicitBucketHistogramAggregationConfigBlueprint.java
#	telemetry/opentelemetry-config/src/main/java/io/helidon/telemetry/otelconfig/MetricExporterConfigBlueprint.java
#	telemetry/opentelemetry-config/src/main/java/io/helidon/telemetry/otelconfig/MetricExporterConfigSupport.java
#	telemetry/opentelemetry-config/src/main/java/io/helidon/telemetry/otelconfig/MetricReaderConfigBlueprint.java
#	telemetry/opentelemetry-config/src/main/java/io/helidon/telemetry/otelconfig/OpenTelemetryConfigSupport.java
#	telemetry/opentelemetry-config/src/main/java/io/helidon/telemetry/otelconfig/OpenTelemetryMetricsConfigBlueprint.java
#	telemetry/opentelemetry-config/src/main/java/io/helidon/telemetry/otelconfig/OpenTelemetryMetricsConfigSupport.java
#	telemetry/opentelemetry-config/src/main/java/io/helidon/telemetry/otelconfig/TypedAttributes.java
#	telemetry/opentelemetry-config/src/test/java/io/helidon/telemetry/otelconfig/TestMetricsConfig.java
@tjquinno tjquinno force-pushed the 4.x-otel-metrics-semconv branch from 25fa938 to 1f769d7 Compare February 13, 2026 21:28
@tjquinno tjquinno marked this pull request as ready for review February 15, 2026 23:44
@tjquinno tjquinno changed the title 4.x Support OpenTelemetry metrics semantic conventions (server) 4.x Support OpenTelemetry metrics semantic conventions (server); allow selection of which endpoints collected for OTel, REST.request, and KPI metrics Feb 15, 2026
@tjquinno tjquinno marked this pull request as draft February 16, 2026 16:48
@tjquinno
Copy link
Member Author

Replaced by #11168

@tjquinno tjquinno closed this Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

1 participant