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
Conversation
8115670 to
024f980
Compare
f2f40a3 to
25fa938
Compare
…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
…fig files we cannot link to
25fa938 to
1f769d7
Compare
Member
Author
|
Replaced by #11168 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
REST.requesttimersYou can now control which REST endpoints are measured by adding configuration under
server.features.observe.observer.metrics.autoto 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-metricscomponent.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
filtermethod, 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
autoDocumentation
Doc update included.