You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(opentelemetry): add protobuf protocol support for OTLP exporters
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>
This adds a `protocol` option to `Otlp.layer`, `OtlpTracer.layer`, `OtlpMetrics.layer`, and `OtlpLogger.layer` that allows choosing between JSON (default) and Protocol Buffers binary encoding when exporting telemetry data to OpenTelemetry collectors.
8
+
9
+
```typescript
10
+
import { Otlp } from"@effect/opentelemetry"
11
+
12
+
// Use protobuf encoding for more efficient wire format
13
+
Otlp.layer({
14
+
baseUrl: "http://localhost:4318",
15
+
protocol: "protobuf",
16
+
resource: { serviceName: "my-service" }
17
+
})
18
+
```
19
+
20
+
- No new dependencies - protobuf encoding implemented from scratch
21
+
- Sets appropriate Content-Type header (`application/x-protobuf` vs `application/json`)
0 commit comments