Skip to content

feat: Allow to define custom otel span processors #2979

@Yuripetusko

Description

@Yuripetusko

Is your feature request related to a problem? Please describe.

Hi following up on my long standing battle to make vercel ai sdk traces to show up in Sentry's AI dashboard, would it be possible to allow us to pass custom otel span processors?

Because right now there's no way to allow sentry to edit/wrap ai sdk spans with the metadata they need to display them in their auto-generated AI traces dashboard. The only option they have is through Sentry SDK VercelAiIntegration, but this only works if we let Sentry register Otel provider. Since trigger dev owns otel, then the only option for Sentry to see any traces sent from trigger dev is to pass Sentry as custom otelp exporter, but with this method they have no way to enrich ai sdk spans.

They suggested to me that if I could use span processor then they could ship a version of ai sdk processor this way too, but trigger dev doesn't really allow to add custom processors afaik.

Describe the solution you'd like to see

Allow us to pass custom opentelemetry span processor alongside existing exporters and instrumentations

getsentry/sentry#106244 (comment)

Describe alternate solutions

Not sure

Additional information

getsentry/sentry#106244 (comment)
https://docs.sentry.io/platforms/javascript/guides/node/opentelemetry/custom-setup/
https://docs.sentry.io/platforms/javascript/guides/connect/configuration/integrations/vercelai/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions