Skip to content

Ab/otlp integration #19730

@github-actions

Description

@github-actions

Note

The pull request "Ab/otlp integration" was created by @andreiborza but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.

Added otlpIntegration at @sentry/node-core/light/otlp for users who manage their own OpenTelemetry setup and want to send trace data to Sentry without adopting the full @sentry/node SDK.

import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
import * as Sentry from '@sentry/node-core/light';
import { otlpIntegration } from '@sentry/node-core/light/otlp';

const provider = new NodeTracerProvider();
provider.register();

Sentry.init({
  dsn: '__DSN__',
  integrations: [
    otlpIntegration({
      // Export OTel spans to Sentry via OTLP (default: true)
      setupOtlpTracesExporter: true,

      // Propagate sentry-trace/baggage headers (default: true)
      setupPropagator: true,

      // Capture span.recordException() as Sentry errors (default: false)
      captureExceptions: false,
    }),
  ],
});

Split up for easier reviewing:

  • functionality to register a function to get the propagation context from OTel: 863136d
  • OTLP integration: 067218c
  • e2e tests: b608187
  • CHANGELOG entry: 1bf9f6e

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions