-
Notifications
You must be signed in to change notification settings - Fork 812
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
feat!: move serialization to @opentelemetry/otlp-transformer
#4542
feat!: move serialization to @opentelemetry/otlp-transformer
#4542
Conversation
83f37c6
to
552e29b
Compare
@@ -1,6 +1,6 @@ | |||
[submodule "experimental/packages/otlp-grpc-exporter-base/protos"] | |||
path = experimental/packages/otlp-grpc-exporter-base/protos | |||
url = https://github.com/open-telemetry/opentelemetry-proto.git | |||
[submodule "experimental/packages/otlp-proto-exporter-base/protos"] |
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: we'll be able to remove this submodule here too in the follow-up to do the same to the browser exporters.
552e29b
to
694d4d0
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4542 +/- ##
==========================================
+ Coverage 90.77% 92.72% +1.94%
==========================================
Files 90 330 +240
Lines 1930 9555 +7625
Branches 417 2048 +1631
==========================================
+ Hits 1752 8860 +7108
- Misses 178 695 +517
|
694d4d0
to
5d8a094
Compare
5d8a094
to
c79779d
Compare
c79779d
to
dfffc23
Compare
92f2e42
to
79256ed
Compare
3bdffc4
to
e3af80d
Compare
e3af80d
to
c14bc9b
Compare
…telemetry#4542) * feat!:move serializers to otlp-transformer * feat!: use serializeres in protobuf and json exporters * test(otlp-transformer): add tests for trace serializer * test(otlp-transformer): add tests for metrics serializer * test(otlp-transformer): add tests for logs serializer * chore: resolve more conflicts * fix: sync package-lock * chore: cleanup dependencies, unused code, .gitignore * chore: fix changelog indentation * fix(otlp-transformer): remove unused useHex from JsonMetricsSerializer * chore: add comment about how logs data is structured * docs: move submodule.md, adapt contents * fixup! Merge branch 'main' into feat/transformer-serializer * fixup! Merge branch 'main' into feat/transformer-serializer
Which problem is this PR solving?
This is the follow-up I talked about in #4432 (comment).
This PR pulls out the protobuf and JSON serialization code into the
@opentelemetry/otlp-transformer
package. This PR only touches the Node.js specific exporters, but I plan to do the same with the browser exporters in a follow up, as it'll allow us to get rid of some duplication and simplify the exporters structure. Right now the diff in this PR already very large, so splitting it in two PRs is likely the better option.Once done for the browser exporters, we can change the public interface
@opentelemetry/otlp-transformer
to only be the serializers, and the responses. This minimal interface, and eliminating theconvert()
step in the exporter then also opens up the possibility to implement a custom protobuf serializer as proposed in #4385 without large changes to the public API.This is also a preparation to #4116. This is currently very hard to do as the transport also handled some serialization (see diff), pulling that out is the first step to make a PR to gradually introduce the structure that I've prepared at #4415.
Also prepares for #3183 as we currently don't have a way to deserialize responses due to the way we structure the exporters. Implementing this is currently also very difficult as it always incurs a very large diff that is near impossible to review. Using the structure from this PR implementing the feature will become a lot easier. See #4415 for a proposal on how to handle partial success once refactored.
Breaking
OTLPExporterNodeBase
now has additional constructor parameters that are requiredOTLPExporterNodeBase
now has an additional type parameterconvert()
now returns an empty object. In a follow-up (feat!: use serializers in browser exporters #4581) the method will be removed as it's not necessary anymore.Updates #4116
Updates #4583
Type of change
How Has This Been Tested?