Skip to content
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!: use serializers in browser exporters #4581

Conversation

pichlermarc
Copy link
Member

@pichlermarc pichlermarc commented Mar 26, 2024

Description

Follow-up to #4542, applies the ISerializers from that PR to the browser exporters.

  • deletes @opentelemetry/otlp-proto-exporter-base as the base classes are not needed anymore (serialization is handled in the same way as for JSON)
  • removes convert() from all exporters as it's now handled by the ISerializers
  • removes the intermediate type (RequestType) from the type parameter list of the exporter base
    • since getting rid of convert() this is now fully internal and can be removed along with sub-types in a follow-up PR
      • doing this will reduce API surface by 40+ types and functions

Breaking:

  • OTLPExporterBase: removed RequestType from type parameters
  • OTLPExporterBase: removed OTLPExporterBase#convert()
  • OTLPExporterBrowserBase: constructor now requires an ISerializer and contentType
  • @opentelemetry/otlp-proto-exporter-base was removed as serialization is now part of @opentelemetry/otlp-transformer, base classes from @opentelemetry/otlp-exporter-base can now be used instead of the protobuf-specific ones.

Enables #4116
Follows: #4542

Copy link

codecov bot commented Mar 26, 2024

Codecov Report

Attention: Patch coverage is 97.18310% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 92.86%. Comparing base (2610122) to head (826e28a).
Report is 18 commits behind head on main.

❗ Current head 826e28a differs from pull request most recent head 1002a1e. Consider uploading reports for the commit 1002a1e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4581      +/-   ##
==========================================
+ Coverage   90.77%   92.86%   +2.08%     
==========================================
  Files          90      330     +240     
  Lines        1930     9518    +7588     
  Branches      417     2041    +1624     
==========================================
+ Hits         1752     8839    +7087     
- Misses        178      679     +501     
Files Coverage Δ
...ges/exporter-logs-otlp-grpc/src/OTLPLogExporter.ts 100.00% <ø> (ø)
...-otlp-http/src/platform/browser/OTLPLogExporter.ts 100.00% <100.00%> (ø)
...ogs-otlp-http/src/platform/node/OTLPLogExporter.ts 100.00% <100.00%> (ø)
...gs-otlp-proto/src/platform/node/OTLPLogExporter.ts 100.00% <100.00%> (ø)
.../exporter-trace-otlp-grpc/src/OTLPTraceExporter.ts 100.00% <ø> (ø)
...tlp-http/src/platform/browser/OTLPTraceExporter.ts 100.00% <100.00%> (ø)
...e-otlp-http/src/platform/node/OTLPTraceExporter.ts 100.00% <100.00%> (ø)
...-otlp-proto/src/platform/node/OTLPTraceExporter.ts 100.00% <100.00%> (ø)
...porter-metrics-otlp-grpc/src/OTLPMetricExporter.ts 100.00% <ø> (ø)
...er-metrics-otlp-http/src/OTLPMetricExporterBase.ts 94.11% <ø> (ø)
... and 10 more

... and 226 files with indirect coverage changes

@pichlermarc pichlermarc force-pushed the feat/transformer-serializer-browser branch from 826e28a to 5651eb7 Compare April 26, 2024 14:25
@pichlermarc pichlermarc marked this pull request as ready for review April 26, 2024 14:44
@pichlermarc pichlermarc requested a review from a team April 26, 2024 14:44
Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks this looks great!

@pichlermarc pichlermarc merged commit 1c5de7a into open-telemetry:main May 3, 2024
19 checks passed
@pichlermarc pichlermarc deleted the feat/transformer-serializer-browser branch May 3, 2024 16:25
@legendecas legendecas mentioned this pull request May 8, 2024
2 tasks
Zirak pushed a commit to Zirak/opentelemetry-js that referenced this pull request Sep 14, 2024
* feat!: use serializer in browser exporters

* feat!: remove unused convert

* fixup! feat!: use serializer in browser exporters

* chore: update changleog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants