From 9f46ea5c482c53b4b8aefcdbc1521adf49c5fc2e Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Fri, 10 Jul 2026 11:26:46 +0200 Subject: [PATCH] feat(attributes): Add `litestar.middleware_name` (deprecated) in favor of `middleware.name` Co-Authored-By: Claude Opus 4.6 --- .../sentry-conventions/src/attributes.ts | 57 ++++++++++++++++++- .../litestar/litestar__middleware_name.json | 23 ++++++++ .../middleware/middleware__name.json | 5 ++ python/src/sentry_conventions/attributes.py | 42 ++++++++++++++ 4 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 model/attributes/litestar/litestar__middleware_name.json diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 041ac192..4b354bc2 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -8477,6 +8477,30 @@ export const LCP_URL = 'lcp.url'; */ export type LCP_URL_TYPE = string; +// Path: model/attributes/litestar/litestar__middleware_name.json + +/** + * The name of the Litestar middleware. `litestar.middleware_name` + * + * Attribute Value Type: `string` {@link LITESTAR_MIDDLEWARE_NAME_TYPE} + * + * Apply Scrubbing: manual + * + * Attribute defined in OTEL: No + * Visibility: public + * + * Aliases: {@link MIDDLEWARE_NAME} `middleware.name` + * + * @deprecated Use {@link MIDDLEWARE_NAME} (middleware.name) instead - This attribute is being deprecated in favor of middleware.name, which is the framework-agnostic replacement. + * @example "AuthenticationMiddleware" + */ +export const LITESTAR_MIDDLEWARE_NAME = 'litestar.middleware_name'; + +/** + * Type for {@link LITESTAR_MIDDLEWARE_NAME} litestar.middleware_name + */ +export type LITESTAR_MIDDLEWARE_NAME_TYPE = string; + // Path: model/attributes/logger/logger__name.json /** @@ -9649,6 +9673,8 @@ export type METHOD_TYPE = string; * Attribute defined in OTEL: No * Visibility: public * + * Aliases: {@link LITESTAR_MIDDLEWARE_NAME} `litestar.middleware_name` + * * @example "AuthenticationMiddleware" */ export const MIDDLEWARE_NAME = 'middleware.name'; @@ -15386,6 +15412,7 @@ export const ATTRIBUTE_TYPE: Record = { 'lcp.renderTime': 'integer', 'lcp.size': 'integer', 'lcp.url': 'string', + 'litestar.middleware_name': 'string', 'logger.name': 'string', 'mcp.cancelled.reason': 'string', 'mcp.cancelled.request_id': 'string', @@ -16068,6 +16095,7 @@ export type AttributeName = | typeof LCP_RENDERTIME | typeof LCP_SIZE | typeof LCP_URL + | typeof LITESTAR_MIDDLEWARE_NAME | typeof LOGGER_NAME | typeof MCP_CANCELLED_REASON | typeof MCP_CANCELLED_REQUEST_ID @@ -21634,6 +21662,28 @@ export const ATTRIBUTE_METADATA: Record = { aliases: ['browser.web_vital.lcp.url'], changelog: [{ version: '0.5.0', prs: [233] }, { version: '0.1.0', prs: [127] }, { version: '0.0.0' }], }, + 'litestar.middleware_name': { + brief: 'The name of the Litestar middleware.', + type: 'string', + applyScrubbing: { + key: 'manual', + }, + isInOtel: false, + visibility: 'public', + example: 'AuthenticationMiddleware', + deprecation: { + replacement: 'middleware.name', + reason: + 'This attribute is being deprecated in favor of middleware.name, which is the framework-agnostic replacement.', + }, + aliases: ['middleware.name'], + changelog: [ + { + version: 'next', + description: 'Added litestar.middleware_name attribute, deprecated in favor of middleware.name', + }, + ], + }, 'logger.name': { brief: 'The name of the logger that generated this event.', type: 'string', @@ -22347,7 +22397,11 @@ export const ATTRIBUTE_METADATA: Record = { isInOtel: false, visibility: 'public', example: 'AuthenticationMiddleware', - changelog: [{ version: '0.6.0', prs: [336], description: 'Added middleware.name attribute' }], + aliases: ['litestar.middleware_name'], + changelog: [ + { version: 'next', description: 'Added litestar.middleware_name as an alias' }, + { version: '0.6.0', prs: [336], description: 'Added middleware.name attribute' }, + ], }, 'navigation.type': { brief: 'The type of navigation done by a client-side router.', @@ -25778,6 +25832,7 @@ export type Attributes = { [LCP_RENDERTIME]?: LCP_RENDERTIME_TYPE; [LCP_SIZE]?: LCP_SIZE_TYPE; [LCP_URL]?: LCP_URL_TYPE; + [LITESTAR_MIDDLEWARE_NAME]?: LITESTAR_MIDDLEWARE_NAME_TYPE; [LOGGER_NAME]?: LOGGER_NAME_TYPE; [MCP_CANCELLED_REASON]?: MCP_CANCELLED_REASON_TYPE; [MCP_CANCELLED_REQUEST_ID]?: MCP_CANCELLED_REQUEST_ID_TYPE; diff --git a/model/attributes/litestar/litestar__middleware_name.json b/model/attributes/litestar/litestar__middleware_name.json new file mode 100644 index 00000000..8dae713b --- /dev/null +++ b/model/attributes/litestar/litestar__middleware_name.json @@ -0,0 +1,23 @@ +{ + "key": "litestar.middleware_name", + "brief": "The name of the Litestar middleware.", + "type": "string", + "apply_scrubbing": { + "key": "manual" + }, + "is_in_otel": false, + "example": "AuthenticationMiddleware", + "alias": ["middleware.name"], + "deprecation": { + "_status": "backfill", + "replacement": "middleware.name", + "reason": "This attribute is being deprecated in favor of middleware.name, which is the framework-agnostic replacement." + }, + "visibility": "public", + "changelog": [ + { + "version": "next", + "description": "Added litestar.middleware_name attribute, deprecated in favor of middleware.name" + } + ] +} diff --git a/model/attributes/middleware/middleware__name.json b/model/attributes/middleware/middleware__name.json index 3a609a86..46414e55 100644 --- a/model/attributes/middleware/middleware__name.json +++ b/model/attributes/middleware/middleware__name.json @@ -7,8 +7,13 @@ }, "is_in_otel": false, "example": "AuthenticationMiddleware", + "alias": ["litestar.middleware_name"], "visibility": "public", "changelog": [ + { + "version": "next", + "description": "Added litestar.middleware_name as an alias" + }, { "version": "0.6.0", "prs": [336], diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 90122d51..1095c166 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -220,6 +220,7 @@ class _AttributeNamesMeta(type): "LCP_SIZE", "LCP_URL", "LCP", + "LITESTAR_MIDDLEWARE_NAME", "MCP_PROMPT_NAME", "MCP_REQUEST_ID", "MCP_RESOURCE_PROTOCOL", @@ -5067,6 +5068,21 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: 2500 """ + # Path: model/attributes/litestar/litestar__middleware_name.json + LITESTAR_MIDDLEWARE_NAME: Literal["litestar.middleware_name"] = ( + "litestar.middleware_name" + ) + """The name of the Litestar middleware. + + Type: str + Apply Scrubbing: manual + Defined in OTEL: No + Visibility: public + Aliases: middleware.name + DEPRECATED: Use middleware.name instead - This attribute is being deprecated in favor of middleware.name, which is the framework-agnostic replacement. + Example: "AuthenticationMiddleware" + """ + # Path: model/attributes/logger/logger__name.json LOGGER_NAME: Literal["logger.name"] = "logger.name" """The name of the logger that generated this event. @@ -5732,6 +5748,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Apply Scrubbing: manual Defined in OTEL: No Visibility: public + Aliases: litestar.middleware_name Example: "AuthenticationMiddleware" """ @@ -14327,6 +14344,26 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ), ], ), + "litestar.middleware_name": AttributeMetadata( + brief="The name of the Litestar middleware.", + type=AttributeType.STRING, + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + is_in_otel=False, + visibility=Visibility.PUBLIC, + example="AuthenticationMiddleware", + deprecation=DeprecationInfo( + replacement="middleware.name", + reason="This attribute is being deprecated in favor of middleware.name, which is the framework-agnostic replacement.", + status=DeprecationStatus.BACKFILL, + ), + aliases=["middleware.name"], + changelog=[ + ChangelogEntry( + version="next", + description="Added litestar.middleware_name attribute, deprecated in favor of middleware.name", + ), + ], + ), "logger.name": AttributeMetadata( brief="The name of the logger that generated this event.", type=AttributeType.STRING, @@ -15094,7 +15131,11 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): is_in_otel=False, visibility=Visibility.PUBLIC, example="AuthenticationMiddleware", + aliases=["litestar.middleware_name"], changelog=[ + ChangelogEntry( + version="next", description="Added litestar.middleware_name as an alias" + ), ChangelogEntry( version="0.6.0", prs=[336], @@ -18626,6 +18667,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "lcp.size": int, "lcp.url": str, "lcp": float, + "litestar.middleware_name": str, "logger.name": str, "mcp.cancelled.reason": str, "mcp.cancelled.request_id": str,