-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(tracing): Add transaction source field #5367
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
Conversation
This patch adds `source` information to `Transaction`, which is typed by `TransactionSource` in `@sentry/tracing`. This helps track how the name of a transaction was determined, which will be used by the server for server-side controls. For now, we are placing the `source` field under transaction metadata. In the future, we can move this up into a top level API (an argument to `startTransaction` or `transaction.setSource`) if needed, but this should be fine to get us started. For next steps, after this patch gets merged, we will start going through various routing instrumentation frameworks and adding transaction source.
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. Had some questions.
One more question: We're using setMetadata
for the time being to not expose Transaction.setSource
as public API, correct?
Yes exactly! We can come back and change this later if needed. |
Thanks for clarifying, makes sense to me! |
FWIW, we don't need to do this, I don't think, because we can just do |
… an unparameterized URL (#5392) This patch re-introduces the `transaction` field in the Dynamic Sampling Context (DSC). However, its presence is now determined by the [transaction source](https://develop.sentry.dev/sdk/event-payloads/transaction/#transaction-annotations) which was introduced in #5367. As of this we we add the `transaction` field back, if the source indicates that the transaction name is not an unparameterized URL (meaning, the source is set and it is not `url`). Additionally, the PR (once again) adjusts our unit and integration tests to reflect this change. Repurposed some DSC<=>`sendDefaultPii` tests that we previously skipped to now cover the transaction<=>transaction source dependence. Did some cleanup of commented out old code and explanations that no longer apply. Remove he `'unknown'` field from the `TransactionSource` type because it is only used by Relay and SDKs shouldn't set it.
Ref: #5345
This patch adds
source
information toTransaction
, which is typed byTransactionSource
in@sentry/tracing
. This helps track how the name of a transaction was determined, which will be used by the server forserver-side controls.
For now, we are placing the
source
field under transaction metadata. In the future, we can move this up into a top level API (an argument tostartTransaction
ortransaction.setSource
) if needed, but this should be fine to get us started.For next steps, after this patch gets merged, we will start going through various routing instrumentation frameworks and adding transaction source.