sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Set user agent span attribute on standalone spans

Open mydea opened this issue 1 year ago • 0 comments

While investigating https://github.com/getsentry/sentry-javascript/issues/11646, we found the root of the problem:

INP ingestion depends on the user agent (because it differs by browser). When using a tunnel the user-agent may often not be forwarded, leading to INP not being measured correctly.

We should fix this server-side by not ignoring INP spans without a user agent, but we should also add the user agent as an attribute to these spans so they can be used (if set) to improve handling.

Based on https://opentelemetry.io/docs/specs/semconv/attributes-registry/user-agent/, we should set user_agent.original to the full user agent string.

mydea avatar Jun 28 '24 06:06 mydea