-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): Create types and utilities for span links (#15375)
This is the base for adding span links to the SDK. Those types will be used both our OTel and Core SDK.
- Loading branch information
Showing
7 changed files
with
180 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { SpanAttributeValue, SpanContextData } from './span'; | ||
|
||
type SpanLinkAttributes = { | ||
/** | ||
* Setting the link type to 'previous_trace' helps the Sentry product linking to the previous trace | ||
*/ | ||
'sentry.link.type'?: string | 'previous_trace'; | ||
} & Record<string, SpanAttributeValue | undefined>; | ||
|
||
export interface SpanLink { | ||
/** | ||
* Contains the SpanContext of the span to link to | ||
*/ | ||
context: SpanContextData; | ||
/** | ||
* A key-value pair with primitive values or an array of primitive values | ||
*/ | ||
attributes?: SpanLinkAttributes; | ||
} | ||
|
||
/** | ||
* Link interface for the event envelope item. It's a flattened representation of `SpanLink`. | ||
* Can include additional fields defined by OTel. | ||
*/ | ||
export interface SpanLinkJSON extends Record<string, unknown> { | ||
span_id: string; | ||
trace_id: string; | ||
sampled?: boolean; | ||
attributes?: SpanLinkAttributes; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters