Skip to content

Conversation

shakuzen
Copy link
Member

@shakuzen shakuzen commented Aug 7, 2025

Adds an ObservationConvention implementation for the Apache HC 5 instrumentation that follows the latest (at this time) OpenTelemetry semantic conventions for HTTP clients. Also adds an ObservationDocumentation for it as well.

Documentation has been updated to demonstrate how the convention can be configured with the instrumentation.

Adds an ObservationConvention implementation for the Apache HC 5 instrumentation that follows the latest (at this time) OpenTelemetry semantic conventions for HTTP clients.
Also adds an ObservationDocumentation for it as well.
This will be needed by other HTTP instrumentation.
URL {
@Override
public String asString() {
return "url.full";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth mentioning that we have a uri KeyValue on the existing DefaultApacheHttpClientObservationConvention where we try to get a templated URI (although we can't if users don't provide a way to access it). The equivalent in OTel HTTP client semantic conventions is url.template, but it is currently not marked stable. This means that HTTP client metrics using the stable OTel semantic conventions will have no information about the URL being called.

Specifically, status and port are defined as ints. Uses 0 and -1 for the case when they are unknown/undefined.
@shakuzen shakuzen marked this pull request as ready for review August 8, 2025 08:32
@jonatan-ivanov jonatan-ivanov added this to the 1.16.0-M2 milestone Aug 8, 2025
@jonatan-ivanov jonatan-ivanov merged commit 2ecb766 into micrometer-metrics:main Aug 8, 2025
11 checks passed
@jonatan-ivanov jonatan-ivanov deleted the oh-tell-me-why branch August 8, 2025 19:56
izeye added a commit to izeye/micrometer that referenced this pull request Aug 9, 2025
Signed-off-by: Johnny Lim <izeye@naver.com>
@izeye izeye mentioned this pull request Aug 9, 2025
jonatan-ivanov pushed a commit that referenced this pull request Aug 11, 2025
Signed-off-by: Johnny Lim <izeye@naver.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants