-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use semantic convention APIs for opentelemetry #2662
Conversation
1848712
to
8254ce3
Compare
Motivation: Today the tags are manually handcrafted with strings, if the opentelemetry api changes, the tags will be outdated, using the instrumenter available from the io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv we can make it all dynamic based on the specification without understanding the specification and its tags. Result: API will become more stable and evolve easier together with opentelemetry, no more handcrafted strings and the conventions will be driven by the instrumentation API.
8254ce3
to
192afd3
Compare
...try-http/src/main/java/io/servicetalk/opentelemetry/http/OpenTelemetryHttpRequestFilter.java
Outdated
Show resolved
Hide resolved
...etry-http/src/main/java/io/servicetalk/opentelemetry/http/OpenTelemetryHttpServerFilter.java
Outdated
Show resolved
Hide resolved
...opentelemetry-http/src/main/java/io/servicetalk/opentelemetry/http/OpentelemetryOptions.java
Outdated
Show resolved
Hide resolved
...opentelemetry-http/src/main/java/io/servicetalk/opentelemetry/http/OpentelemetryOptions.java
Outdated
Show resolved
Hide resolved
...tp/src/main/java/io/servicetalk/opentelemetry/http/ServicetalkNetClientAttributesGetter.java
Outdated
Show resolved
Hide resolved
...main/java/io/servicetalk/opentelemetry/http/ServicetalkHttpClientCommonAttributesGetter.java
Outdated
Show resolved
Hide resolved
...main/java/io/servicetalk/opentelemetry/http/ServicetalkHttpClientCommonAttributesGetter.java
Outdated
Show resolved
Hide resolved
@@ -52,21 +59,62 @@ | |||
*/ | |||
public final class OpenTelemetryHttpServerFilter extends AbstractOpenTelemetryFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should rename this to OpenTelemetryHttpServiceFilter
to have proper alignment with the client?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming will break clients who are already using it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can introduce new names and deprecate all names (not in this PR, in a follow-up)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, will do in a follow up PR
@@ -54,17 +63,42 @@ | |||
public final class OpenTelemetryHttpRequestFilter extends AbstractOpenTelemetryFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should rename this to OpenTelemetryHttpClientFilter
to have proper alignment with the service?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's too late. We cannot break the contract with clients, renaming will cause a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in this PR, but in a follow up it will be nice to rename it to OpenTelemetryHttpRequesterFilter to be consistent with all other filters. We use "requester" on the client-side because all clients and connections implement HttpRequester
interface.
For backward compatibility, we can deprecate current OpenTelemetryHttpRequestFilter
and link to OpenTelemetryHttpRequesterFilter
as a replacement.
...tp/src/main/java/io/servicetalk/opentelemetry/http/ServicetalkNetClientAttributesGetter.java
Outdated
Show resolved
Hide resolved
servicetalk-http-api/src/main/java/io/servicetalk/http/api/HttpProtocolVersion.java
Outdated
Show resolved
Hide resolved
...try-http/src/main/java/io/servicetalk/opentelemetry/http/OpenTelemetryHttpRequestFilter.java
Outdated
Show resolved
Hide resolved
...try-http/src/main/java/io/servicetalk/opentelemetry/http/OpenTelemetryHttpRequestFilter.java
Outdated
Show resolved
Hide resolved
...try-http/src/main/java/io/servicetalk/opentelemetry/http/OpenTelemetryHttpRequestFilter.java
Outdated
Show resolved
Hide resolved
...etry-http/src/main/java/io/servicetalk/opentelemetry/http/OpenTelemetryHttpServerFilter.java
Outdated
Show resolved
Hide resolved
...try-http/src/main/java/io/servicetalk/opentelemetry/http/RequestHeadersPropagatorGetter.java
Outdated
Show resolved
Hide resolved
...p/src/main/java/io/servicetalk/opentelemetry/http/ServicetalkHttpServerAttributesGetter.java
Outdated
Show resolved
Hide resolved
...p/src/main/java/io/servicetalk/opentelemetry/http/ServicetalkHttpServerAttributesGetter.java
Outdated
Show resolved
Hide resolved
...tp/src/main/java/io/servicetalk/opentelemetry/http/ServicetalkNetServerAttributesGetter.java
Outdated
Show resolved
Hide resolved
...tp/src/main/java/io/servicetalk/opentelemetry/http/ServicetalkNetServerAttributesGetter.java
Outdated
Show resolved
Hide resolved
...try-http/src/main/java/io/servicetalk/opentelemetry/http/ServicetalkSpanStatusExtractor.java
Outdated
Show resolved
Hide resolved
...try-http/src/main/java/io/servicetalk/opentelemetry/http/OpenTelemetryHttpRequestFilter.java
Outdated
Show resolved
Hide resolved
...etry-http/src/main/java/io/servicetalk/opentelemetry/http/OpenTelemetryHttpServerFilter.java
Outdated
Show resolved
Hide resolved
@@ -52,21 +59,62 @@ | |||
*/ | |||
public final class OpenTelemetryHttpServerFilter extends AbstractOpenTelemetryFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can introduce new names and deprecate all names (not in this PR, in a follow-up)
@@ -54,17 +63,42 @@ | |||
public final class OpenTelemetryHttpRequestFilter extends AbstractOpenTelemetryFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in this PR, but in a follow up it will be nice to rename it to OpenTelemetryHttpRequesterFilter to be consistent with all other filters. We use "requester" on the client-side because all clients and connections implement HttpRequester
interface.
For backward compatibility, we can deprecate current OpenTelemetryHttpRequestFilter
and link to OpenTelemetryHttpRequesterFilter
as a replacement.
...tp/src/main/java/io/servicetalk/opentelemetry/http/ServicetalkNetClientAttributesGetter.java
Outdated
Show resolved
Hide resolved
...main/java/io/servicetalk/opentelemetry/http/ServicetalkHttpClientCommonAttributesGetter.java
Outdated
Show resolved
Hide resolved
...tp/src/main/java/io/servicetalk/opentelemetry/http/ServicetalkNetServerAttributesGetter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed 2 commits to address the last comments I have below:
...try-http/src/main/java/io/servicetalk/opentelemetry/http/OpenTelemetryHttpRequestFilter.java
Outdated
Show resolved
Hide resolved
...elemetry-http/src/main/java/io/servicetalk/opentelemetry/http/CancelledRequestException.java
Outdated
Show resolved
Hide resolved
...ntelemetry-http/src/main/java/io/servicetalk/opentelemetry/http/HeadersPropagatorGetter.java
Outdated
Show resolved
Hide resolved
...etry-http/src/main/java/io/servicetalk/opentelemetry/http/OpenTelemetryHttpServerFilter.java
Outdated
Show resolved
Hide resolved
...opentelemetry-http/src/main/java/io/servicetalk/opentelemetry/http/OpentelemetryOptions.java
Outdated
Show resolved
Hide resolved
...opentelemetry-http/src/main/java/io/servicetalk/opentelemetry/http/OpentelemetryOptions.java
Outdated
Show resolved
Hide resolved
...opentelemetry-http/src/main/java/io/servicetalk/opentelemetry/http/OpentelemetryOptions.java
Outdated
Show resolved
Hide resolved
...opentelemetry-http/src/main/java/io/servicetalk/opentelemetry/http/OpentelemetryOptions.java
Outdated
Show resolved
Hide resolved
...p/src/main/java/io/servicetalk/opentelemetry/http/ServicetalkHttpServerAttributesGetter.java
Outdated
Show resolved
Hide resolved
...tp/src/main/java/io/servicetalk/opentelemetry/http/ServicetalkNetServerAttributesGetter.java
Outdated
Show resolved
Hide resolved
the changes look good. I made a test and it looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Motivation:
Today the tags are manually handcrafted with strings, if the opentelemetry api changes, the tags will be outdated, using the instrumenter available from the
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv
we can make it all dynamic based on the specification without understanding the specification and its tags.Result:
API will become more stable and evolve easier together with opentelemetry, no more handcrafted strings and the conventions will be driven by the instrumentation API.