-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
7.106.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
a
Expected Result
Formless issue; I am genually confused about traces/transactions/spans.
I thought I understood how all goes together (a trace is a collection of transactions, a transaction is a collection of spans, scopes are pushed and popped within a transaction and enrich events generated within them), but recent deprecations have left me wondering.
I want to set a tag on a transaction ("cache.hit"), and it all seems pretty straightforward with Sentry.getActiveTransaction()?.setTag('cache.hit', true);, both methods now deprecated. So Sentry.getActiveSpan()?.setAttribute('cache.hit', true). This, however, ends up settings the tag as an attribute, and only on the very span the tag was set in.
Also, unrelated to above, how do I prevent two separate transactions (minutes apart) from using the same trace ID? When a koa request comes in, I run the handler within Sentry.startSpan(() => { ... }), two transactions end up in the same trace. The only top-level "trace" method is Sentry.continueTrace, but that doesn't sound right.
Actual Result
a
Metadata
Metadata
Assignees
Labels
Projects
Status