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 trace gRPC exporter #1922
OTLP trace gRPC exporter #1922
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1922 +/- ##
=======================================
- Coverage 79.3% 76.3% -3.0%
=======================================
Files 141 157 +16
Lines 7553 8358 +805
=======================================
+ Hits 5992 6380 +388
- Misses 1313 1723 +410
- Partials 248 255 +7
|
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.
Overall I think the approach show in this PR should be adopted. I think this PR, though large, is properly scoped for the initial PR for a signal in the OTLP and should be marked ready for review so it can be thoroughly reviewed.
I'm assuming there would be follow on PRs to:
- add the HTTP driver for traces
- add a similarly scoped metrics client with gRPC driver
- add an HTTP metrics driver (?)
We should also include a PR to finish the changes that updates the README: https://github.com/open-telemetry/opentelemetry-go/blob/main/exporters/otlp/README.md |
Can you please add #1827 to the PR description? I spend a few minutes to find it 😉 It would be good if you rebase your branch. It misses changes introduced here: d23cc61 First of all, I agree with @paivagustavo that these packages should be "self-contained" so that the user can just like this: General design comments for the whole I feel that the the When I am looking at opentelemetry-go/exporters/otlp/protocoldriver.go Lines 25 to 52 in f06cace
From a user perspective, I would like just to use When we (contributors) feel that the stuff under I feel that it might be better to redesign the whole |
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 like where it's going. I think this would be an acceptable way forward.
I know with the shared otel/grpc
and internal
this might not work, but would it be easier to maintain and communicate to users if this was under exporters/trace/otel
? I think we pontificated on it a bit in the meeting, so if it's not possible or it makes things messier let's not do it.
I really do not like the idea of using import path to indicate experimental status and requiring users to change all of their imports and references when stability is reached. Semver has a perfectly fine way of indicating that an API is experimental and unstable, major version 0. Using a different import path would seem to violate this tenet of the OTel versioning guidelines.
|
I see your points. I will think about it a few more times (maybe I will even edit this comment if totally I change my mind 😄 ). I see the With my proposal I try to achieve the following:
What other solution do we have? Create a new package each time we want to create a new unstable API? Then the discovery of packages that contain new features would be harder. Loose thoughts (it is chaotic) I am aware that the semantic import versioning has its drawbacks: https://peter.bourgon.org/blog/2020/09/14/siv-is-unsound.html "Requiring users to change all of their imports" is a general property of Go modules. The users would need to change it anyway if we ever create a new major version. Having a different import path for the "stable" and "unstable" packages reduces the possibility that a user would have the diamond problem. If done properly, the diamond problem could only occur for packages that are using unstable imports and the stable one should always work if the "stable" packages follow SemVer. A broken build is more punishing than just changing the import path. Still, I suggested keeping the source code under |
Sorry abou that, I've added it to the description along with a todo list for closing that issue.
Thanks for catching that, rebased. About the experimental package, I would say that we keep away of that. The I'm going to mark this PR as ready to review, and will start to get the others PRs moving as well. |
Thanks for the comment and description. It is very clear to me and I like the plan 👍 Initially, I thought that we may want to consider implementing both metrics and traces exporter in one struct. However, I think the way you outlined is better. |
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 think this needs more godoc and test coverage before I can approve it, but I think this is definitely on the right track. Let's discuss at the SIG meeting tomorrow how we can sequence the steps you've outlined to get the trace exporters in shape ASAP to enable an RC and then we can worry about metrics.
I've copied the This does duplicate a bunch of code, that could be refactored in the future once the old Sorry for this big PR. |
…o otlp_trace_split � Conflicts: � CHANGELOG.md
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.
🥇
For the test failures, |
I am still not sure about the design of I feel that exporting a common exporter struct is a smell:
Let me ask a question from the API client-side. Should the user ever need to use the The If we go further with the current design, then the At this point, I would suggest removing I also put a little comment here for visibility: #1827 (comment) |
They way it is designed, users and vendors may implement their own client. One of the reasons for such custom client would be #1819 (comment).
The Exporter is only supposed to implement the I understand your reasoning about the existence of a We can go either direction, and it is easy to move this package to an |
Even if we want to have |
Go doesn't have subclassing, so I'm not sure that the LSP is applicable. If you want to think in terms of classical inheritance, I would view |
My concern is that this function returns a concrete struct from another package. Not an "abstract class" or interface. I am not against using |
Writing from mobile I remember that some Options where wrapped in otlp folder to mitigate similar issue. Edit: I believe this design makes it easier to maintain backwards compatibility. |
Not a blocker because this is internal. I noticed that the grpc connection struct was moved into the otlptrace package. Is the plan to have this mostly copied when we make the otlpmetric? If we move it back to otlp, or have copies I think either will work. |
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.
During SIG meeting @Aneurysm9 has explained why we are OK using the same exporter struct for both modules.
Quick explanation:
This introduces
otlptrace
package, defining a traceClient
interface and traceExporter
struct that implements the otel sdk exporter interface. This replaces theProtocolDriver
interface and describe an interface specific for the trace exporter.The
otlptracegrpc
adds a client that implements theotlptrace.Client
. Most of this was part of theexporters/otlp/otlpgrpc/driver.go
.The
otlp/grpc
folder contains thegrpc
connection logic that will be used by both the metrics and tracesClient
. This still needs to be a module to not add thegrpc
dependency on theotlp
package. This is a copy from the existing code inotlpgrpc/connection.go
The
otlptracetest
containts the integration test for the otlp traceExporter
, to test it with bothgrpc
andhttp
clients. This is a copy from the existing codeexporters/otlp/internal/otlptest
.Tests were mainly copied from the existing tests and removed the metrics part of them.
How users will interact with it
The sugar functions to create and install an pipeline was added directly to the
otlptracegrpc
pacakge. This means that the users only needs to interact with it to create/install a trace pipeline to the sdk.or
What comes next?
This is part of the #1827 todo list:
update proto-go dependencies