-
-
Notifications
You must be signed in to change notification settings - Fork 507
feat(opentelemetry): add protobuf protocol support for OTLP exporters #5927
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
Merged
tim-smart
merged 10 commits into
Effect-TS:main
from
davidgoli:feat/otel-protobuf-support
Jan 21, 2026
Merged
feat(opentelemetry): add protobuf protocol support for OTLP exporters #5927
tim-smart
merged 10 commits into
Effect-TS:main
from
davidgoli:feat/otel-protobuf-support
Jan 21, 2026
+1,561
−24
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🦋 Changeset detectedLatest commit: bf369fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Add support for Protocol Buffers binary encoding as an alternative to JSON
for OTLP trace, metrics, and log exports. This enables more efficient
wire format when communicating with OpenTelemetry collectors.
- Add `protocol` option ("json" | "protobuf") to Otlp.layer and individual
OtlpTracer, OtlpMetrics, OtlpLogger layers
- Implement protobuf wire format encoding following opentelemetry-proto specs
- Set appropriate Content-Type header (application/x-protobuf vs application/json)
- No new dependencies - protobuf encoding implemented from scratch
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
09584a8 to
27cd330
Compare
tim-smart
requested changes
Jan 19, 2026
…tobuf support Refactors OTLP exporters to use a serializer service pattern, enabling tree-shaking of protobuf code when only JSON encoding is used. - Add OtlpSerializer service with JSON layer (default) - Add OtlpSerializerProtobuf layer for explicit protobuf opt-in - Remove direct protobuf imports from exporters (key for tree-shaking) - Update Otlp.layer to provide JSON serializer by default - Backwards compatible: existing JSON code works unchanged Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
f7dc1f0 to
93dc380
Compare
Contributor
|
I have added this to effect 4.0 here: Effect-TS/effect-smol#1023 Feel free to copy back the tweaks here :) |
Simplifies the protobuf support API based on tim-smart's design from effect-smol. API changes: - Added Otlp.layerJson and Otlp.layerProtobuf for explicit serialization choice - Otlp.layer remains as backwards-compatible alias for layerJson - Removed layerWithSerializer (use layerJson/layerProtobuf instead) - Replaced OtlpSerializer/OtlpSerializerProtobuf with OtlpSerialization service - OtlpSerialization now returns HttpBody directly instead of Uint8Array | string Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
|
@tim-smart done, please take another look |
tim-smart
requested changes
Jan 21, 2026
- Use class syntax with type ID for OtlpSerialization (Context.Tag pattern) - Remove OtlpKind from otlpExporter - exporter doesn't need to know data type - Lift encode function selection to individual services (OtlpTracer, OtlpMetrics, OtlpLogger) - Exporter now receives encode function directly via options Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
44854e8 to
c973e33
Compare
tim-smart
approved these changes
Jan 21, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type
Description
Add support for Protocol Buffers binary encoding as an alternative to JSON for OTLP trace, metrics, and log exports. This enables more efficient wire format when communicating with OpenTelemetry collectors. In particular, some OTLP collectors, such as Coralogix, only support protobuf and not json.
protocoloption ("json" | "protobuf") to Otlp.layer and individual OtlpTracer, OtlpMetrics, OtlpLogger layers🤖 Generated with Claude Code
Related