-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Introduce OpenTelemetry collector #2086
Introduce OpenTelemetry collector #2086
Conversation
cmd/opentelemetry-collector/main.go
Outdated
|
||
// TODO caused compilation issues due to refactoring in https://github.com/jaegertracing/jaeger/pull/2060 | ||
// TODO app/HandlerConfig moved to app/handler/HandlerConfig | ||
//cmpts, err := defaults.Components() |
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 could not initialize all default components (importers, processors, exporters) because Jaeger importer imports jaeger/collector/app and there was a breaking change #2060
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.
Once open-telemetry/opentelemetry-collector#570 is merged we should be able to use defaults.components()
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 commented on open-telemetry/opentelemetry-collector#570 and we can merge it quickly if it blocks you.
cmd/opentelemetry-collector/main.go
Outdated
package main | ||
|
||
import ( | ||
"github.com/open-telemetry/opentelemetry-collector/config" |
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.
there should be a corresponding change in Gopkg.toml
So importing For instance a breaking change in this repo might result in a compilation error (like in https://github.com/jaegertracing/jaeger/pull/2086/files/de7040ace7ce90518b1ff99c32f471a801d6665c#diff-bc7bd0edae17579706fb28fa796dd8cf). The opposite approach might be to move Jaeger components here and import them in opentelemetry-collector if we assume that OTEL interfaces will not break (I assume they will break less than Jaeger code). An alternative solution might be to re-implement jaeger components directly here and use those instead. We could just import a shared Jaeger configuration from OTEL (It would have to be moved to a separate package). I frankly don't like this option. Also Jaeger uses Any thoughts @yurishkuro @tigrannajaryan? |
This would mean this repo references opentelemetry-collector and opentelemetry-collector references this repo. I do not know if go modules allow a circular references between repos, but even if it does it will not look nice. I'd rather not do it. Alternatively we could references Jaeger components located in this repo from opentelemetry-collector-contrib. That would no longer be a circular reference, however it would put Jaeger out of core build, which I would not want to do (among other things we committed to having built-in support for Jaeger in Collector core).
Yeah, this does not sound like a good solution. Lots of code duplication.
I have no experience mixing the 2 approaches. |
@pavolloffay can you enumerate which parts of Jaeger the OTel Collector imports? |
|
Is it possible to extract the common jaeger components into packages, say at |
It is possible, but I don’t like it. It will make jaeger development harder by moving critical parts to another repo. |
One way or another there will be a cyclic dependency if we want to have the jaeger-opentelemetry-collector in this repository. I think it will be better to host as much as possible Jaeger related code in Jaeger repository. We could have OTEL importer, processor, exporter like API implementation in Jaeger (not direct import of OTEL). Then the actual Jaeger importer, processor, exporter will use this package to implement OTEL components. This way if we break API in Jaeger it will not result in a compilation error like it did now. OpenTelemetry will be able to break API too as the jaeger importers, processors will be implemented directly in the OTEL. |
@pavolloffay maybe it’s worth trying these cross-repo imports on a couple toy projects using go mod. |
If we agree that Jaeger can be moved to |
If you use go.mod then every go.mod containing directory is considered a separate module (minus subdirectories that contain their own go.mod files). So even though it is a circular dependency between repos, it will no longer be considered a circular dependency between go modules if you structure them appropriately (and I think go tooling should be fine with it, but don't trust my word, I never tried this actual setting).
Makes sense. |
First we should migrate to go modules #2098. Based on this PR I have tried importing Jaeger in OTEL via override, the build worked and I was able to build Jaeger with imported OTEL (This is the option 2). Then there are two approaches we can take:
Option 1. seems like a better option to` me. Although, I found several comments on github discouraging this approach especially when the module should serve as a library or API, but we are just trying to use it for the main package mainly. I didn't find any exact reasons why. I will have to experiment more with this.
|
what do you mean by that? |
Use go submodules. Multiple go modules in a single repository. |
5332679
to
a17bab7
Compare
@@ -0,0 +1,9 @@ | |||
module github.com/jaegertracing/jaeger/cmd/opentelemetry-collector |
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.
@yurishkuro this is an example fo go submodule.
By default Jaeger version would be resolved from OTEL collector, but with replace
we are able to point it to the current master/head. If we do a breaking change we can pin the version to a version prior the change and collaborate with OTEL to update the code there.
9e3ac6a
to
02304e7
Compare
@yurishkuro we should make progress on this one. The work in https://github.com/jaegertracing/jaeger-opentelemetry-collector will require changes in the core. For instance changing storage writers to work on the batches rather than on a single spans https://github.com/jaegertracing/jaeger-opentelemetry-collector/issues/15. |
is there an open question? |
There aren't any open questions. It just needs to be merged if we agree that this can go in. A separate go module for the otel collector is the safest path for now. There are still breaking changes happening if there wasn't we could import it in the root package. There was a discussion regarding the versioning. The jaeger-otel collector will follow the version schema for with jaeger binaries, so with regards to this point it is also fine. |
Codecov Report
@@ Coverage Diff @@
## master #2086 +/- ##
=======================================
Coverage 96.13% 96.13%
=======================================
Files 218 218
Lines 10564 10564
=======================================
Hits 10156 10156
Misses 353 353
Partials 55 55 Continue to review full report at Codecov.
|
@@ -0,0 +1,50 @@ | |||
// Copyright (c) 2020 The Jaeger Authors. |
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.
what is the binary file above? probably don't want it checked in.
.travis.yml
Outdated
@@ -36,6 +36,9 @@ matrix: | |||
- go: "1.13.x" | |||
env: | |||
- HOTROD=true | |||
- go: "1.13.x" |
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.
Why do we need a separate matrix step for it? I'd rather include it in the main build.
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.
+1 this was just to quickly test the build. I will remove it
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2a7ed3d
to
35974f9
Compare
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Fixes jaegertracing/jaeger-opentelemetry-collector#8
Signed-off-by: Pavol Loffay ploffay@redhat.com