Skip to content

Capture exceptions from OpenTelemetry span events #16015

Open
@sadriddin

Description

@sadriddin

Problem Statement

I would like to request a way to capture exceptions from OpenTelemetry span events as Sentry errors in my NestJS application. Currently, exceptions that occur and are recorded in OpenTelemetry spans are not being converted to Sentry errors, which limits my error tracking capabilities.

According to the SDK documentation (https://develop.sentry.dev/sdk/telemetry/traces/opentelemetry), exceptions from span events should be converted to Sentry errors. I noticed this feature was removed in PR #11221 with a mention that it might return as an opt-in feature in the future.

Environment

  • Sentry SDK version: "@sentry/nestjs": "^9.9.0"
  • OpenTelemetry version: "@opentelemetry/sdk-node": "0.57.2", "@opentelemetry/api": "1.9.0"
  • Platform/language: Node.js/NestJS

Solution Brainstorm

I would greatly appreciate if this feature could be reintroduced as an opt-in configuration option. I noticed this functionality is already implemented in the .NET SDK https://github.com/getsentry/sentry-dotnet/blob/762c056ea9102bf93c7dd5c4e0055d661dcf1ec8/src/Sentry.OpenTelemetry/SentrySpanProcessor.cs#L447 , which could perhaps serve as a reference for the JavaScript/Node.js implementation.

An opt-in approach would allow users who need this functionality to enable it while not affecting those who don't require it. This would be incredibly helpful for my error monitoring workflow.

Thank you for considering this request!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions