Skip to content

Filter OpenTelemetry traces caused by Sentry #9127

Closed
@hkrutzer

Description

@hkrutzer

Problem Statement

I am sending OpenTelemetry to a service X that isn't Sentry. I want to start sending it to Sentry as well, but because Sentry only supports sending it via the SDK, I have to add the Sentry spanprocessor. However, this causes additional traces from Sentry itself to show up in X as well (from instrumentation-net and instrumentation-http).

These are unrelated to my application and I don't want to store them. Otel Collector doesn't allow discarding specific spans and their children as far as I can tell, so it would be great if I could filter them from the SDK configuration.

Solution Brainstorm

In https://github.com/getsentry/sentry-javascript/blob/develop/packages/opentelemetry-node/src/spanprocessor.ts#L93-L100 there is some code that prevents HTTP requests to Sentry from being sent as telemetry to Sentry. Perhaps this can be used to prevent these requests from going to other OpenTelemetry services as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions