Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the docs better for how to use traceSampler() functions #12507

Open
Dhrumil-Sentry opened this issue Jan 29, 2025 · 1 comment
Open
Assignees

Comments

@Dhrumil-Sentry
Copy link

Problem Statement

Got this feedback on discord and I felt our docs mention just use span.name but the product unfortunately does not have span.name yet - So we should atleast tell the user show to find this field for what they're trying to filter

Image

Solution Brainstorm

Add hints on how to see the name/attributes of spans - and use span.desc for now?

@Lms24
Copy link
Member

Lms24 commented Jan 29, 2025

Transferring to docs, as this doesn't require SDK changes.

Add hints on how to see the name/attributes of spans

The code example in docs already shows that users can access attributes from the passed sampling context variable. Do you have a concrete idea what we should show here? I can add another condition that checks for a specific attribute for example.

and use span.desc for now

we can't because at this point (i.e. shortly before the SDK starts the span), the span only has a name, which users or our instrumentation will pass to startSpan({name: '...'}, () => {}). We should also keep it this way because this is the same API used in OpenTelemetry. Only later on, when the span ends and it is serialized, the name is converted to the span description. Not ideal for users, I agree, but long-term we'll move to name only as far as I understand.

@Lms24 Lms24 transferred this issue from getsentry/sentry-javascript Jan 29, 2025
@Lms24 Lms24 self-assigned this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants