getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.87k stars 1.55k forks source link

Send User to Sentry with Opentelemetry #9177

Open thyming opened 11 months ago

thyming commented 11 months ago

Problem Statement

I'd like to have the user appear as normal in Sentry when using the OpenTelemetry tracing APIs.

Solution Brainstorm

OTel has SemanticAttributes.ENDUSER_ID which could be a good convention to use to propagate the user to Sentry.

mydea commented 11 months ago

Hi,

could you provide more details on your setup/what you are doing.

Are you using @sentry/opentelemetry-node? How are you setting the user? How does your SDK setup look like?

thyming commented 11 months ago

Yes, I am using @sentry/opentelemetry-node. I would like to not use @sentry/node apis, but still set the user using OTel APIs in such a way that it appears in Sentry as if I had used Sentry.setUser(...).

mydea commented 11 months ago

OK, I see.

This is something we are currently working on in the ingestion layer - eventually, this should work. I can't give you a timeline on when this will work, but it's on the roadmap for our improved OpenTelemetry support.

Until this is shipped, you'll have to set the user via @sentry/node APIs - right now, that's the only way to get this properly set. We'll keep you posted in this issue when we have news on this!