Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.8k
draft: Add metadata around transaction name changes#5709
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
68d6ebafead24676af3e3d16a3538c00b713ef0b80e9ccebd0178205File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -35,6 +35,7 @@ import { | ||
| SyncPromise, | ||
| truncate, | ||
| uuid4, | ||
| timestampInSeconds, | ||
| } from '@sentry/utils'; | ||
| import { getEnvelopeEndpointWithUrlEncodedAuth } from './api'; | ||
| @@ -653,6 +654,29 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> { | ||
| throw new SentryError('`beforeSend` returned `null`, will not send event.', 'log'); | ||
| } | ||
| const transactionInfo = processedEvent.transaction_info; | ||
| if ( | ||
| processedEvent.type === 'transaction' && | ||
| transactionInfo && | ||
| processedEvent.transaction && | ||
| processedEvent.transaction !== event.transaction | ||
| ) { | ||
| const source = 'custom'; | ||
| event.transaction_info = { | ||
| ...transactionInfo, | ||
| source, | ||
| name_changes: [ | ||
| ...transactionInfo.name_changes, | ||
| { | ||
| name: processedEvent.transaction, | ||
lobsterkatie marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| source, | ||
| timestamp: timestampInSeconds(), | ||
| propagations: transactionInfo.propagations, | ||
| }, | ||
| ], | ||
| }; | ||
| } | ||
| const session = scope && scope.getSession(); | ||
| if (!isTransaction && session) { | ||
| this._updateSessionFromEvent(session, processedEvent); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -150,6 +150,12 @@ export interface TransactionMetadata { | ||
| /** Metadata for the transaction's spans, keyed by spanId */ | ||
| spanMetadata: { [spanId: string]: { [key: string]: unknown } }; | ||
| /** Metadata representing information about transaction name changes */ | ||
| nameChanges: TransactionNameChange[]; | ||
| /** The total number of propagations that happened */ | ||
| propagations: number; | ||
| } | ||
| /** | ||
| @@ -169,3 +175,15 @@ export type TransactionSource = | ||
| | 'component' | ||
| /** Name of a background task (e.g. a Celery task) */ | ||
| | 'task'; | ||
| /** | ||
| * Object representing metadata about when a transaction name was changed. | ||
| */ | ||
| export interface TransactionNameChange { | ||
| // unix timestamp when the name was changed | ||
| timestamp: number; | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FTR: The develop spec and Relay protocol definition should use the same type as other timestamps in the protocol, allowing for ISO strings in addition to numbers. | ||
| // new source | ||
| source: TransactionSource; | ||
| // number of propagations since start of transaction. | ||
| propagations: number; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.