-
Notifications
You must be signed in to change notification settings - Fork 836
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(exporter-metrics-otlp-proto)!: rewrite exporter #4415
base: main
Are you sure you want to change the base?
feat(exporter-metrics-otlp-proto)!: rewrite exporter #4415
Conversation
24ac55e
to
2faaf13
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4415 +/- ##
==========================================
- Coverage 92.23% 91.65% -0.59%
==========================================
Files 336 350 +14
Lines 9533 9853 +320
Branches 2022 2096 +74
==========================================
+ Hits 8793 9031 +238
- Misses 740 822 +82
|
12412bf
to
31beec7
Compare
8c16cba
to
e86d354
Compare
…lities for HTTP exporters
…rt and configuration
…e-implemented base
e86d354
to
e9f90ca
Compare
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
removing stale as this is still active as a reference for future PRs, will close once all changes are merged. |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
NOTE: Draft PR, do not review yet.
Which problem is this PR solving?
It is currently very hard to test individual features of the OTLP exporters. This is due to the following issues:
This PR proposes a new structure for all OTLP exporters, starting with
@opentelemetry/exporter-metrics-otlp-proto
.It splits it into the following key parts by introducing interfaces for them, which allows us to mock any of these for testing:
IExporterTransport
([otlp-exporter-base] refactor exporters to use a pluggable transport layer #4116)http
(nodejs),grpc
(nodejs),xhr
(Browser), orsendBeacon
(Browser)ISerializer
json
orprotobuf
(can be re-used with grpc)ITransformer
@opentelemetry/otlp-transformer
package.IExportPromiseQueue
IResponseHandler
It further split out configuration-code into separate files that handle defaults-merging and environment parsing, and allows us to leave out references to environment configuration from exporters intended for the browser. This aids with testability as we now can test environment parsing separately from default-merging. Partially addresses #3193, where the wrong environment variable was used for the compression value (the trace setting was used over metrics).
It also introduces a factory function for exporters in each exporter package, that's intended to replace the
OLTP*Exporter
exporter classes. To keep backwards compatibility, theOTLP*Exporter
classes are still retained and they translate the "old" configuration to the "new" one.Reasoning for some design decisions:
introducing and splitting
@opentelemetry/otlp-http-exporter-node-base
@opentelemetry/otlp-http-exporter-browser-base
packages:@opentelemetry/otlp-exporter-base
@opentelemetry/otlp-grpc-exporter-base
existed already, finding the HTTP-related code was not easy.introducing the
@opentelemetry/otlp-metrics-exporter-base
package:keeping legacy exporter class vs factory function approach:
retiring everything that's not generated protobuf from the proto-exporter-base package.
adding a browser exporter for
@opentelemetry/exporter-metrics-otlp-proto
([exporter-metrics-otlp-proto] Add browser support #4098):using factory functions and interfaces over exposing the actual types:
url
,headers
or other things that can be taken as a signal that these can/should be modified on runtime.Open questions before this PR is ready for review:
main
, or should we targetnext
?Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: