-
Notifications
You must be signed in to change notification settings - Fork 856
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
OTLP HTTP trace exporter #3418
OTLP HTTP trace exporter #3418
Conversation
I added the Keeping it in Another thing to think is whether to shade the new dependencies on |
...on/src/main/java/io/opentelemetry/exporter/otlp/internal/HexEncodingStringJsonGenerator.java
Outdated
Show resolved
Hide resolved
...ters/otlp/trace/src/main/java/io/opentelemetry/exporter/otlp/trace/OtlpHttpSpanExporter.java
Outdated
Show resolved
Hide resolved
...ters/otlp/trace/src/main/java/io/opentelemetry/exporter/otlp/trace/OtlpHttpSpanExporter.java
Outdated
Show resolved
Hide resolved
...ters/otlp/trace/src/main/java/io/opentelemetry/exporter/otlp/trace/OtlpHttpSpanExporter.java
Outdated
Show resolved
Hide resolved
...lp/trace/src/main/java/io/opentelemetry/exporter/otlp/trace/OtlpHttpSpanExporterBuilder.java
Outdated
Show resolved
Hide resolved
...lp/trace/src/main/java/io/opentelemetry/exporter/otlp/trace/OtlpHttpSpanExporterBuilder.java
Outdated
Show resolved
Hide resolved
...lp/trace/src/main/java/io/opentelemetry/exporter/otlp/trace/OtlpHttpSpanExporterBuilder.java
Outdated
Show resolved
Hide resolved
I think it would be unfortunate if otlp grpc users suddenly got an okhttp dependency thrust upon them, forcing them to exclude it to keep their artifact smaller (and avoid version clashes). so, if we want to put them in the same module, we should definitely shade-in okhttp. |
Let's use a different module - I expect a very small minority of users to need this module so want to reduce it's discoveribility vs our "standard recommendation" grpc. |
@@ -28,6 +28,10 @@ dependencies { | |||
implementation("io.grpc:grpc-stub") | |||
implementation("com.google.protobuf:protobuf-java") | |||
|
|||
implementation("com.squareup.okhttp3:okhttp:4.9.0") |
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.
Let's target okhttp3 to not pull in kotlin stdlib. This will be especially important if we shade (let's not worry about it in the first PR)
Any thoughts on publishing both shaded and not shaded (the one use case made easy by Gradle shadow plugin : 😹)?
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! I'm inclined to keep the surface area smaller and choosing to either shade or not shade. Can always publish additional artifacts later, but it's harder to stop publishing.
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.
On second thought, maybe okhttp3 isn't such a great idea. Its only getting critical fixes through December 31st, 2021. And since we're going with the separate module route, it doesn't seem as critical that the kotlin stdlib is included.
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.
3.12.x isn't getting updates, but the 4.x will be.
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.
Ah I didn't know about the EoL then seems ok (indeed especially with the separate module)
...lp/trace/src/main/java/io/opentelemetry/exporter/otlp/trace/OtlpHttpSpanExporterBuilder.java
Outdated
Show resolved
Hide resolved
@Override | ||
public RequestBody build(ExportTraceServiceRequest exportTraceServiceRequest) { | ||
return RequestBody.create( | ||
exportTraceServiceRequest.toByteArray(), MediaType.parse("application/x-protobuf")); |
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.
It can and probably should be a future PR but would definitely be good to use okio buffer and codedinputstream to skip the intermediate unpooled buffer
@anuraaga thanks for the great feedback! Very helpful. For the separate modules, how about: |
Codecov Report
@@ Coverage Diff @@
## main #3418 +/- ##
============================================
- Coverage 90.84% 90.83% -0.02%
Complexity 3228 3228
============================================
Files 368 368
Lines 9941 9941
Branches 1003 1003
============================================
- Hits 9031 9030 -1
Misses 598 598
- Partials 312 313 +1
Continue to review full report at Codecov.
|
...g-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingSpanExporter.java
Outdated
Show resolved
Hide resolved
...http/trace/src/main/java/io/opentelemetry/exporter/otlp/http/trace/OtlpHttpSpanExporter.java
Outdated
Show resolved
Hide resolved
...ace/src/main/java/io/opentelemetry/exporter/otlp/http/trace/OtlpHttpSpanExporterBuilder.java
Outdated
Show resolved
Hide resolved
...ace/src/main/java/io/opentelemetry/exporter/otlp/http/trace/OtlpHttpSpanExporterBuilder.java
Outdated
Show resolved
Hide resolved
...ace/src/main/java/io/opentelemetry/exporter/otlp/http/trace/OtlpHttpSpanExporterBuilder.java
Outdated
Show resolved
Hide resolved
.../trace/src/test/java/io/opentelemetry/exporter/otlp/http/trace/OtlpHttpSpanExporterTest.java
Outdated
Show resolved
Hide resolved
|
||
private static final MediaType APPLICATION_PROTOBUF = | ||
MediaType.create("application", "x-protobuf"); | ||
private static final HeldCertificate HELD_CERTIFICATE; |
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.
Note: I've used the the certificate utility from okhttp-tls
instead of the SelfSignedCertificateExtension
seen in other tests. I did this because the certificate from SelfSignedCertificateExtension
doesn't include a subject alternative name and the okhttp client fails TLS validation without this field.
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.
Ah yeah I noticed this too separately - quite bizarre okhttp restriction
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.
Thanks a lot, almost there
|
||
private static final MediaType APPLICATION_PROTOBUF = | ||
MediaType.create("application", "x-protobuf"); | ||
private static final HeldCertificate HELD_CERTIFICATE; |
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.
Ah yeah I noticed this too separately - quite bizarre okhttp restriction
...http/trace/src/main/java/io/opentelemetry/exporter/otlp/http/trace/OtlpHttpSpanExporter.java
Show resolved
Hide resolved
...http/trace/src/main/java/io/opentelemetry/exporter/otlp/http/trace/OtlpHttpSpanExporter.java
Outdated
Show resolved
Hide resolved
...http/trace/src/main/java/io/opentelemetry/exporter/otlp/http/trace/OtlpHttpSpanExporter.java
Outdated
Show resolved
Hide resolved
.../trace/src/test/java/io/opentelemetry/exporter/otlp/http/trace/OtlpHttpSpanExporterTest.java
Outdated
Show resolved
Hide resolved
.../trace/src/test/java/io/opentelemetry/exporter/otlp/http/trace/OtlpHttpSpanExporterTest.java
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.
Thanks, just found one small point left. @jkwatson is on vacation but let's give him a chance to review before merging.
...http/trace/src/main/java/io/opentelemetry/exporter/otlp/http/trace/OtlpHttpSpanExporter.java
Outdated
Show resolved
Hide resolved
Since this is a new module that isn't marked |
@jkwatson actually could use a pointer on that. There's no apidiffs because I've commented out the
Seems like a chicken and the egg issue: can't add publish conventions until there's an artifact out there that can be used as a comparison point for the apidiffs. I know the apidiff stuff is fairly new - is there a playbook on how to proceed adding a new module? |
I thought @anuraaga had fixed this issue so that it would generate a new file for a new module. Curious why you commented out publishing, though... shouldn't this be published? |
It should be published. I commented out publishing because the build fails with this error when publishing is enabled. Let me see if I can't dig into it a bit more and get to the bottom of why new modules are causing this issue. |
hmm. interesting. If you can't sort this out, I can try to take a look (or perhaps @anuraaga will know the problem right away). |
Looking closer at the otel.japicmp-conventions.gradle.kts config, I don't think this is actually a solved problem:
One way we could solve this is by adding another property to new projects that haven't been published yet, such as |
Something like this seems totally reasonable to me. Or, we institute a policy where every new module has to go through at least one alpha release before it is made non-alpha, which would also solve the problem. What do you think about that, @anuraaga ? |
Do we need a new flag? I guess we can disable the task if oldClasspath is invalid, so that'd be pretty easy. If it's not obvious how to do it I can look into that. Let's merge this first though. |
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.
Thanks!
Can someone please specify this change is part of which open telemetry java agent? I have tried with Open Telemetry Java Agent 1.5.3 but it seems this change is not present. |
I think you should ask that in https://github.com/open-telemetry/opentelemetry-java-instrumentation. As displayed by GitHub, this change is included in version 1.5.0 of "core" opentelemetry-java. |
@Oberon00 : Thank you for your quick response. Sure I will ask this question in htts://github.com/open-telemetry/opentelemetry-java-instrumentation.. |
@sumitm-iiit BTW, under https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#otlp-exporter-both-span-and-metric-exporters there is |
OTLP HTTP trace exporter implementation.