The otlpIntegration in @sentry/node-core/light forwards spans to Sentry's OTLP endpoint or a custom collector via OTLPTraceExporter + BatchSpanProcessor. No equivalent exists for browser environments, and log forwarding via OTLP is absent everywhere in the SDK.
Current behavior:
otlpIntegration is Node-only (packages/node-core/src/light/integrations/otlpIntegration.ts); it supports both Sentry's OTLP endpoint and a custom collectorUrl
- Logs always use Sentry's envelope format (
application/vnd.sentry.items.log+json) via createLogEnvelope — no OTLP log path exists in any environment
Gap:
Teams running their own OpenTelemetry collector pipeline can't route spans or logs from browser apps to it via Sentry SDKs. The Node light SDK proves the pattern is viable; the browser gap is primarily about bundle-size gating and ensuring the fetch-based OTLP transport works correctly.
Options:
-
Extend otlpIntegration to browser — OTLPTraceExporter supports fetch/XMLHttpRequest. The main work is tree-shaking the OTel exporter behind an explicit import path (similar to the existing @sentry/node-core/light/otlp entrypoint) to avoid bloating the default bundle.
-
Add OTLP log forwarding — Sentry's SerializedLog shape (severity_number, body, trace_id, OTel-style attributes) maps closely to an OTLP LogRecord. A log exporter option alongside enableLogs: true would let users forward structured logs to any OTLP collector endpoint.
These two options are independent and can be scoped separately.
--
View Junior Session in Sentry
The
otlpIntegrationin@sentry/node-core/lightforwards spans to Sentry's OTLP endpoint or a custom collector viaOTLPTraceExporter+BatchSpanProcessor. No equivalent exists for browser environments, and log forwarding via OTLP is absent everywhere in the SDK.Current behavior:
otlpIntegrationis Node-only (packages/node-core/src/light/integrations/otlpIntegration.ts); it supports both Sentry's OTLP endpoint and a customcollectorUrlapplication/vnd.sentry.items.log+json) viacreateLogEnvelope— no OTLP log path exists in any environmentGap:
Teams running their own OpenTelemetry collector pipeline can't route spans or logs from browser apps to it via Sentry SDKs. The Node light SDK proves the pattern is viable; the browser gap is primarily about bundle-size gating and ensuring the
fetch-based OTLP transport works correctly.Options:
Extend
otlpIntegrationto browser —OTLPTraceExportersupportsfetch/XMLHttpRequest. The main work is tree-shaking the OTel exporter behind an explicit import path (similar to the existing@sentry/node-core/light/otlpentrypoint) to avoid bloating the default bundle.Add OTLP log forwarding — Sentry's
SerializedLogshape (severity_number,body,trace_id, OTel-styleattributes) maps closely to an OTLPLogRecord. A log exporter option alongsideenableLogs: truewould let users forward structured logs to any OTLP collector endpoint.These two options are independent and can be scoped separately.
--
View Junior Session in Sentry