From 4097669af2d8c5e67d228dd3d6bab21b56c042ac Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 8 Jul 2026 10:01:29 +0200 Subject: [PATCH] feat(attributes): Add `navigation.origin` attribute and deprecate sveltekit-specific routing attributes --- .../sentry-conventions/src/attributes.ts | 173 +++++++++++++++++- .../navigation/navigation__origin.json | 19 ++ .../navigation/navigation__type.json | 8 +- .../sentry__sveltekit__navigation__from.json | 24 +++ .../sentry__sveltekit__navigation__to.json | 22 +++ .../sentry__sveltekit__navigation__type.json | 24 +++ python/src/sentry_conventions/attributes.py | 144 +++++++++++++++ 7 files changed, 412 insertions(+), 2 deletions(-) create mode 100644 model/attributes/navigation/navigation__origin.json create mode 100644 model/attributes/sentry/sentry__sveltekit__navigation__from.json create mode 100644 model/attributes/sentry/sentry__sveltekit__navigation__to.json create mode 100644 model/attributes/sentry/sentry__sveltekit__navigation__type.json diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 933c1e6f..2f9cc796 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -9566,6 +9566,29 @@ export const MIDDLEWARE_NAME = 'middleware.name'; */ export type MIDDLEWARE_NAME_TYPE = string; +// Path: model/attributes/navigation/navigation__origin.json + +/** + * The origin of the navigation (usually client side router navigations). Should preferrably parameterized template (like url.template) or a URL path otherwise. `navigation.origin` + * + * Attribute Value Type: `string` {@link NAVIGATION_ORIGIN_TYPE} + * + * Apply Scrubbing: auto + * + * Attribute defined in OTEL: No + * Visibility: public + * + * Aliases: {@link SENTRY_SVELTEKIT_NAVIGATION_FROM} `sentry.sveltekit.navigation.from` + * + * @example "/users/:id" + */ +export const NAVIGATION_ORIGIN = 'navigation.origin'; + +/** + * Type for {@link NAVIGATION_ORIGIN} navigation.origin + */ +export type NAVIGATION_ORIGIN_TYPE = string; + // Path: model/attributes/navigation/navigation__type.json /** @@ -9578,6 +9601,8 @@ export type MIDDLEWARE_NAME_TYPE = string; * Attribute defined in OTEL: No * Visibility: public * + * Aliases: {@link SENTRY_SVELTEKIT_NAVIGATION_TYPE} `sentry.sveltekit.navigation.type` + * * @example "router.push" */ export const NAVIGATION_TYPE = 'navigation.type'; @@ -12571,6 +12596,76 @@ export const SENTRY_STATUS_MESSAGE = 'sentry.status.message'; */ export type SENTRY_STATUS_MESSAGE_TYPE = string; +// Path: model/attributes/sentry/sentry__sveltekit__navigation__from.json + +/** + * the navigation origin (sveltekit router) `sentry.sveltekit.navigation.from` + * + * Attribute Value Type: `string` {@link SENTRY_SVELTEKIT_NAVIGATION_FROM_TYPE} + * + * Apply Scrubbing: auto + * + * Attribute defined in OTEL: No + * Visibility: public + * + * Aliases: {@link NAVIGATION_ORIGIN} `navigation.origin` + * + * @deprecated Use {@link NAVIGATION_ORIGIN} (navigation.origin) instead - Use the more generic attribute instead + * @example "/home" + */ +export const SENTRY_SVELTEKIT_NAVIGATION_FROM = 'sentry.sveltekit.navigation.from'; + +/** + * Type for {@link SENTRY_SVELTEKIT_NAVIGATION_FROM} sentry.sveltekit.navigation.from + */ +export type SENTRY_SVELTEKIT_NAVIGATION_FROM_TYPE = string; + +// Path: model/attributes/sentry/sentry__sveltekit__navigation__to.json + +/** + * the navigation destination `sentry.sveltekit.navigation.to` + * + * Attribute Value Type: `string` {@link SENTRY_SVELTEKIT_NAVIGATION_TO_TYPE} + * + * Apply Scrubbing: auto + * + * Attribute defined in OTEL: No + * Visibility: public + * + * @deprecated - the navigation destination is already covered by url.* attributes + * @example "/users/:id" + */ +export const SENTRY_SVELTEKIT_NAVIGATION_TO = 'sentry.sveltekit.navigation.to'; + +/** + * Type for {@link SENTRY_SVELTEKIT_NAVIGATION_TO} sentry.sveltekit.navigation.to + */ +export type SENTRY_SVELTEKIT_NAVIGATION_TO_TYPE = string; + +// Path: model/attributes/sentry/sentry__sveltekit__navigation__type.json + +/** + * The type of navigation event emitted from the sveltekit client router `sentry.sveltekit.navigation.type` + * + * Attribute Value Type: `string` {@link SENTRY_SVELTEKIT_NAVIGATION_TYPE_TYPE} + * + * Apply Scrubbing: manual + * + * Attribute defined in OTEL: No + * Visibility: public + * + * Aliases: {@link NAVIGATION_TYPE} `navigation.type` + * + * @deprecated Use {@link NAVIGATION_TYPE} (navigation.type) instead - Use the more generic attribute instead + * @example "link" + */ +export const SENTRY_SVELTEKIT_NAVIGATION_TYPE = 'sentry.sveltekit.navigation.type'; + +/** + * Type for {@link SENTRY_SVELTEKIT_NAVIGATION_TYPE} sentry.sveltekit.navigation.type + */ +export type SENTRY_SVELTEKIT_NAVIGATION_TYPE_TYPE = string; + // Path: model/attributes/sentry/sentry__thread__id.json /** @@ -15324,6 +15419,7 @@ export const ATTRIBUTE_TYPE: Record = { 'messaging.system': 'string', method: 'string', 'middleware.name': 'string', + 'navigation.origin': 'string', 'navigation.type': 'string', 'nel.elapsed_time': 'integer', 'nel.phase': 'string', @@ -15461,6 +15557,9 @@ export const ATTRIBUTE_TYPE: Record = { 'sentry.status': 'string', 'sentry.status_code': 'integer', 'sentry.status.message': 'string', + 'sentry.sveltekit.navigation.from': 'string', + 'sentry.sveltekit.navigation.to': 'string', + 'sentry.sveltekit.navigation.type': 'string', 'sentry.thread.id': 'integer', 'sentry.timestamp.sequence': 'integer', 'sentry.trace_lifecycle': 'string', @@ -16001,6 +16100,7 @@ export type AttributeName = | typeof MESSAGING_SYSTEM | typeof METHOD | typeof MIDDLEWARE_NAME + | typeof NAVIGATION_ORIGIN | typeof NAVIGATION_TYPE | typeof NEL_ELAPSED_TIME | typeof NEL_PHASE @@ -16138,6 +16238,9 @@ export type AttributeName = | typeof SENTRY_STATUS | typeof SENTRY_STATUS_CODE | typeof SENTRY_STATUS_MESSAGE + | typeof SENTRY_SVELTEKIT_NAVIGATION_FROM + | typeof SENTRY_SVELTEKIT_NAVIGATION_TO + | typeof SENTRY_SVELTEKIT_NAVIGATION_TYPE | typeof SENTRY_THREAD_ID | typeof SENTRY_TIMESTAMP_SEQUENCE | typeof SENTRY_TRACE_LIFECYCLE @@ -22151,6 +22254,19 @@ export const ATTRIBUTE_METADATA: Record = { example: 'AuthenticationMiddleware', changelog: [{ version: '0.6.0', prs: [336], description: 'Added middleware.name attribute' }], }, + 'navigation.origin': { + brief: + 'The origin of the navigation (usually client side router navigations). Should preferrably parameterized template (like url.template) or a URL path otherwise.', + type: 'string', + applyScrubbing: { + key: 'auto', + }, + isInOtel: false, + visibility: 'public', + example: '/users/:id', + aliases: ['sentry.sveltekit.navigation.from'], + changelog: [{ version: 'next', prs: [467], description: 'Added navigation.origin attribute' }], + }, 'navigation.type': { brief: 'The type of navigation done by a client-side router.', type: 'string', @@ -22160,7 +22276,12 @@ export const ATTRIBUTE_METADATA: Record = { isInOtel: false, visibility: 'public', example: 'router.push', - changelog: [{ version: '0.1.0', prs: [127] }, { version: '0.0.0' }], + aliases: ['sentry.sveltekit.navigation.type'], + changelog: [ + { version: 'next', prs: [467], description: 'Added new deprecated alias' }, + { version: '0.1.0', prs: [127] }, + { version: '0.0.0' }, + ], }, 'nel.elapsed_time': { brief: @@ -23904,6 +24025,52 @@ export const ATTRIBUTE_METADATA: Record = { example: 'foobar', changelog: [{ version: '0.3.1', prs: [190] }], }, + 'sentry.sveltekit.navigation.from': { + brief: 'the navigation origin (sveltekit router)', + type: 'string', + applyScrubbing: { + key: 'auto', + }, + isInOtel: false, + visibility: 'public', + example: '/home', + deprecation: { + replacement: 'navigation.origin', + reason: 'Use the more generic attribute instead', + }, + aliases: ['navigation.origin'], + changelog: [{ version: 'next', prs: [467], description: 'Added sentry.sveltekit.navigation.from attribute' }], + }, + 'sentry.sveltekit.navigation.to': { + brief: 'the navigation destination', + type: 'string', + applyScrubbing: { + key: 'auto', + }, + isInOtel: false, + visibility: 'public', + example: '/users/:id', + deprecation: { + reason: 'the navigation destination is already covered by url.* attributes', + }, + changelog: [{ version: 'next', prs: [467], description: 'Added sentry.sveltekit.navigation.to attribute' }], + }, + 'sentry.sveltekit.navigation.type': { + brief: 'The type of navigation event emitted from the sveltekit client router', + type: 'string', + applyScrubbing: { + key: 'manual', + }, + isInOtel: false, + visibility: 'public', + example: 'link', + deprecation: { + replacement: 'navigation.type', + reason: 'Use the more generic attribute instead', + }, + aliases: ['navigation.type'], + changelog: [{ version: 'next', prs: [467], description: 'Added sentry.sveltekit.navigation.type attribute' }], + }, 'sentry.thread.id': { brief: 'Current “managed” thread ID.', type: 'integer', @@ -25619,6 +25786,7 @@ export type Attributes = { [MESSAGING_SYSTEM]?: MESSAGING_SYSTEM_TYPE; [METHOD]?: METHOD_TYPE; [MIDDLEWARE_NAME]?: MIDDLEWARE_NAME_TYPE; + [NAVIGATION_ORIGIN]?: NAVIGATION_ORIGIN_TYPE; [NAVIGATION_TYPE]?: NAVIGATION_TYPE_TYPE; [NEL_ELAPSED_TIME]?: NEL_ELAPSED_TIME_TYPE; [NEL_PHASE]?: NEL_PHASE_TYPE; @@ -25756,6 +25924,9 @@ export type Attributes = { [SENTRY_STATUS]?: SENTRY_STATUS_TYPE; [SENTRY_STATUS_CODE]?: SENTRY_STATUS_CODE_TYPE; [SENTRY_STATUS_MESSAGE]?: SENTRY_STATUS_MESSAGE_TYPE; + [SENTRY_SVELTEKIT_NAVIGATION_FROM]?: SENTRY_SVELTEKIT_NAVIGATION_FROM_TYPE; + [SENTRY_SVELTEKIT_NAVIGATION_TO]?: SENTRY_SVELTEKIT_NAVIGATION_TO_TYPE; + [SENTRY_SVELTEKIT_NAVIGATION_TYPE]?: SENTRY_SVELTEKIT_NAVIGATION_TYPE_TYPE; [SENTRY_THREAD_ID]?: SENTRY_THREAD_ID_TYPE; [SENTRY_TIMESTAMP_SEQUENCE]?: SENTRY_TIMESTAMP_SEQUENCE_TYPE; [SENTRY_TRACE_LIFECYCLE]?: SENTRY_TRACE_LIFECYCLE_TYPE; diff --git a/model/attributes/navigation/navigation__origin.json b/model/attributes/navigation/navigation__origin.json new file mode 100644 index 00000000..e2f46b72 --- /dev/null +++ b/model/attributes/navigation/navigation__origin.json @@ -0,0 +1,19 @@ +{ + "key": "navigation.origin", + "brief": "The origin of the navigation (usually client side router navigations). Should preferrably parameterized template (like url.template) or a URL path otherwise.", + "type": "string", + "apply_scrubbing": { + "key": "auto" + }, + "is_in_otel": false, + "visibility": "public", + "example": "/users/:id", + "alias": ["sentry.sveltekit.navigation.from"], + "changelog": [ + { + "version": "next", + "prs": [467], + "description": "Added navigation.origin attribute" + } + ] +} diff --git a/model/attributes/navigation/navigation__type.json b/model/attributes/navigation/navigation__type.json index 8315ac69..57f4d8a0 100644 --- a/model/attributes/navigation/navigation__type.json +++ b/model/attributes/navigation/navigation__type.json @@ -9,6 +9,11 @@ "example": "router.push", "visibility": "public", "changelog": [ + { + "version": "next", + "prs": [467], + "description": "Added new deprecated alias" + }, { "version": "0.1.0", "prs": [127] @@ -16,5 +21,6 @@ { "version": "0.0.0" } - ] + ], + "alias": ["sentry.sveltekit.navigation.type"] } diff --git a/model/attributes/sentry/sentry__sveltekit__navigation__from.json b/model/attributes/sentry/sentry__sveltekit__navigation__from.json new file mode 100644 index 00000000..9ca2fcbf --- /dev/null +++ b/model/attributes/sentry/sentry__sveltekit__navigation__from.json @@ -0,0 +1,24 @@ +{ + "key": "sentry.sveltekit.navigation.from", + "brief": "the navigation origin (sveltekit router)", + "type": "string", + "apply_scrubbing": { + "key": "auto" + }, + "is_in_otel": false, + "visibility": "public", + "example": "/home", + "deprecation": { + "replacement": "navigation.origin", + "_status": "backfill", + "reason": "Use the more generic attribute instead" + }, + "alias": ["navigation.origin"], + "changelog": [ + { + "version": "next", + "prs": [467], + "description": "Added sentry.sveltekit.navigation.from attribute" + } + ] +} diff --git a/model/attributes/sentry/sentry__sveltekit__navigation__to.json b/model/attributes/sentry/sentry__sveltekit__navigation__to.json new file mode 100644 index 00000000..d05a9e28 --- /dev/null +++ b/model/attributes/sentry/sentry__sveltekit__navigation__to.json @@ -0,0 +1,22 @@ +{ + "key": "sentry.sveltekit.navigation.to", + "brief": "the navigation destination", + "type": "string", + "apply_scrubbing": { + "key": "auto" + }, + "is_in_otel": false, + "visibility": "public", + "example": "/users/:id", + "deprecation": { + "_status": null, + "reason": "the navigation destination is already covered by url.* attributes" + }, + "changelog": [ + { + "version": "next", + "prs": [467], + "description": "Added sentry.sveltekit.navigation.to attribute" + } + ] +} diff --git a/model/attributes/sentry/sentry__sveltekit__navigation__type.json b/model/attributes/sentry/sentry__sveltekit__navigation__type.json new file mode 100644 index 00000000..ebb81311 --- /dev/null +++ b/model/attributes/sentry/sentry__sveltekit__navigation__type.json @@ -0,0 +1,24 @@ +{ + "key": "sentry.sveltekit.navigation.type", + "brief": "The type of navigation event emitted from the sveltekit client router", + "type": "string", + "apply_scrubbing": { + "key": "manual" + }, + "is_in_otel": false, + "visibility": "public", + "example": "link", + "alias": ["navigation.type"], + "deprecation": { + "replacement": "navigation.type", + "reason": "Use the more generic attribute instead", + "_status": "backfill" + }, + "changelog": [ + { + "version": "next", + "prs": [467], + "description": "Added sentry.sveltekit.navigation.type attribute" + } + ] +} diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 4eda9e50..4cdf1b19 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -260,6 +260,9 @@ class _AttributeNamesMeta(type): "SENTRY_REPORT_EVENT", "_SENTRY_SEGMENT_ID", "SENTRY_SOURCE", + "SENTRY_SVELTEKIT_NAVIGATION_FROM", + "SENTRY_SVELTEKIT_NAVIGATION_TO", + "SENTRY_SVELTEKIT_NAVIGATION_TYPE", "SENTRY_THREAD_ID", "SENTRY_TRACE_PARENT_SPAN_ID", "SENTRY_TRANSACTION", @@ -5680,6 +5683,18 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: "AuthenticationMiddleware" """ + # Path: model/attributes/navigation/navigation__origin.json + NAVIGATION_ORIGIN: Literal["navigation.origin"] = "navigation.origin" + """The origin of the navigation (usually client side router navigations). Should preferrably parameterized template (like url.template) or a URL path otherwise. + + Type: str + Apply Scrubbing: auto + Defined in OTEL: No + Visibility: public + Aliases: sentry.sveltekit.navigation.from + Example: "/users/:id" + """ + # Path: model/attributes/navigation/navigation__type.json NAVIGATION_TYPE: Literal["navigation.type"] = "navigation.type" """The type of navigation done by a client-side router. @@ -5688,6 +5703,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Apply Scrubbing: manual Defined in OTEL: No Visibility: public + Aliases: sentry.sveltekit.navigation.type Example: "router.push" """ @@ -7330,6 +7346,50 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: 200 """ + # Path: model/attributes/sentry/sentry__sveltekit__navigation__from.json + SENTRY_SVELTEKIT_NAVIGATION_FROM: Literal["sentry.sveltekit.navigation.from"] = ( + "sentry.sveltekit.navigation.from" + ) + """the navigation origin (sveltekit router) + + Type: str + Apply Scrubbing: auto + Defined in OTEL: No + Visibility: public + Aliases: navigation.origin + DEPRECATED: Use navigation.origin instead - Use the more generic attribute instead + Example: "/home" + """ + + # Path: model/attributes/sentry/sentry__sveltekit__navigation__to.json + SENTRY_SVELTEKIT_NAVIGATION_TO: Literal["sentry.sveltekit.navigation.to"] = ( + "sentry.sveltekit.navigation.to" + ) + """the navigation destination + + Type: str + Apply Scrubbing: auto + Defined in OTEL: No + Visibility: public + DEPRECATED: No replacement at this time - the navigation destination is already covered by url.* attributes + Example: "/users/:id" + """ + + # Path: model/attributes/sentry/sentry__sveltekit__navigation__type.json + SENTRY_SVELTEKIT_NAVIGATION_TYPE: Literal["sentry.sveltekit.navigation.type"] = ( + "sentry.sveltekit.navigation.type" + ) + """The type of navigation event emitted from the sveltekit client router + + Type: str + Apply Scrubbing: manual + Defined in OTEL: No + Visibility: public + Aliases: navigation.type + DEPRECATED: Use navigation.type instead - Use the more generic attribute instead + Example: "link" + """ + # Path: model/attributes/sentry/sentry__thread__id.json SENTRY_THREAD_ID: Literal["sentry.thread.id"] = "sentry.thread.id" """Current “managed” thread ID. @@ -14950,6 +15010,22 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ), ], ), + "navigation.origin": AttributeMetadata( + brief="The origin of the navigation (usually client side router navigations). Should preferrably parameterized template (like url.template) or a URL path otherwise.", + type=AttributeType.STRING, + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.AUTO), + is_in_otel=False, + visibility=Visibility.PUBLIC, + example="/users/:id", + aliases=["sentry.sveltekit.navigation.from"], + changelog=[ + ChangelogEntry( + version="next", + prs=[467], + description="Added navigation.origin attribute", + ), + ], + ), "navigation.type": AttributeMetadata( brief="The type of navigation done by a client-side router.", type=AttributeType.STRING, @@ -14957,7 +15033,11 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): is_in_otel=False, visibility=Visibility.PUBLIC, example="router.push", + aliases=["sentry.sveltekit.navigation.type"], changelog=[ + ChangelogEntry( + version="next", prs=[467], description="Added new deprecated alias" + ), ChangelogEntry(version="0.1.0", prs=[127]), ChangelogEntry(version="0.0.0"), ], @@ -16748,6 +16828,66 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ChangelogEntry(version="0.4.0", prs=[223, 228]), ], ), + "sentry.sveltekit.navigation.from": AttributeMetadata( + brief="the navigation origin (sveltekit router)", + type=AttributeType.STRING, + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.AUTO), + is_in_otel=False, + visibility=Visibility.PUBLIC, + example="/home", + deprecation=DeprecationInfo( + replacement="navigation.origin", + reason="Use the more generic attribute instead", + status=DeprecationStatus.BACKFILL, + ), + aliases=["navigation.origin"], + changelog=[ + ChangelogEntry( + version="next", + prs=[467], + description="Added sentry.sveltekit.navigation.from attribute", + ), + ], + ), + "sentry.sveltekit.navigation.to": AttributeMetadata( + brief="the navigation destination", + type=AttributeType.STRING, + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.AUTO), + is_in_otel=False, + visibility=Visibility.PUBLIC, + example="/users/:id", + deprecation=DeprecationInfo( + reason="the navigation destination is already covered by url.* attributes" + ), + changelog=[ + ChangelogEntry( + version="next", + prs=[467], + description="Added sentry.sveltekit.navigation.to attribute", + ), + ], + ), + "sentry.sveltekit.navigation.type": AttributeMetadata( + brief="The type of navigation event emitted from the sveltekit client router", + type=AttributeType.STRING, + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + is_in_otel=False, + visibility=Visibility.PUBLIC, + example="link", + deprecation=DeprecationInfo( + replacement="navigation.type", + reason="Use the more generic attribute instead", + status=DeprecationStatus.BACKFILL, + ), + aliases=["navigation.type"], + changelog=[ + ChangelogEntry( + version="next", + prs=[467], + description="Added sentry.sveltekit.navigation.type attribute", + ), + ], + ), "sentry.thread.id": AttributeMetadata( brief="Current “managed” thread ID.", type=AttributeType.INTEGER, @@ -18512,6 +18652,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "messaging.system": str, "method": str, "middleware.name": str, + "navigation.origin": str, "navigation.type": str, "nel.elapsed_time": int, "nel.phase": str, @@ -18649,6 +18790,9 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "sentry.status": str, "sentry.status.message": str, "sentry.status_code": int, + "sentry.sveltekit.navigation.from": str, + "sentry.sveltekit.navigation.to": str, + "sentry.sveltekit.navigation.type": str, "sentry.thread.id": int, "sentry.timestamp.sequence": int, "sentry.trace.parent_span_id": str,