Commit 629db8c
Add gRPC and http/protobuf protocol support to @logtape/otel
This change adds support for gRPC and http/protobuf protocols in the
OpenTelemetry sink, addressing issue #103. The protocol is automatically
selected based on environment variables:
- OTEL_EXPORTER_OTLP_LOGS_PROTOCOL (highest priority)
- OTEL_EXPORTER_OTLP_PROTOCOL (fallback)
- Default: http/json (for backward compatibility)
Key changes:
- Add @opentelemetry/exporter-logs-otlp-grpc and
@opentelemetry/exporter-logs-otlp-proto dependencies
- Refactor OpenTelemetrySinkOptions to union type (provider vs exporter)
- Implement lazy initialization for browser compatibility with gRPC
- Use dynamic imports to avoid loading gRPC code in browsers
- Update OpenTelemetry SDK versions to 0.208.0
- Return Sink & AsyncDisposable type for proper cleanup
- Expand test suite from 10 to 35 comprehensive tests
- Update documentation with protocol selection section
Closes #103
Co-Authored-By: Claude <[email protected]>1 parent e7f3e5b commit 629db8c
File tree
8 files changed
+1401
-156
lines changed- docs/manual
- packages/otel
- src
8 files changed
+1401
-156
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
43 | 85 | | |
44 | 86 | | |
45 | 87 | | |
| |||
0 commit comments