From 1e7a48fe539f03ab25a310d850c83208c9ec4aa9 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Fri, 23 Jan 2026 15:37:15 +0100 Subject: [PATCH] feat(attributes): Add `browser.connection.rtt` attribute --- generated/attributes/all.md | 4 +- generated/attributes/browser.md | 13 ++++ generated/attributes/connection.md | 25 ++++++ generated/attributes/index.md | 1 + .../sentry-conventions/src/attributes.ts | 78 +++++++++++++++++++ .../browser/browser__connection__rtt.json | 12 +++ .../connection/connection__rtt.json | 16 ++++ python/src/sentry_conventions/attributes.py | 48 ++++++++++++ shared/deprecated_attributes.json | 16 ++++ 9 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 generated/attributes/connection.md create mode 100644 model/attributes/browser/browser__connection__rtt.json create mode 100644 model/attributes/connection/connection__rtt.json diff --git a/generated/attributes/all.md b/generated/attributes/all.md index 003120fc..f15146f8 100644 --- a/generated/attributes/all.md +++ b/generated/attributes/all.md @@ -4,7 +4,7 @@ This page lists all available attributes across all categories. -Total attributes: 423 +Total attributes: 425 ## Stable Attributes @@ -25,6 +25,7 @@ Total attributes: 423 | [`ai.warnings`](./ai.md#aiwarnings) | Warning messages generated during model execution. | | [`app_start_type`](./general.md#app_start_type) | Mobile app start variant. Either cold or warm. | | [`blocked_main_thread`](./general.md#blocked_main_thread) | Whether the main thread was blocked by the span. | +| [`browser.connection.rtt`](./browser.md#browserconnectionrtt) | The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds. | | [`browser.name`](./browser.md#browsername) | The name of the browser. | | [`browser.report.type`](./browser.md#browserreporttype) | A browser report sent via reporting API.. | | [`browser.script.invoker`](./browser.md#browserscriptinvoker) | How a script was called in the browser. | @@ -384,6 +385,7 @@ Total attributes: 423 | [`code.function`](./code.md#codefunction) | [`code.function.name`](./code.md#codefunctionname) | | [`code.lineno`](./code.md#codelineno) | [`code.line.number`](./code.md#codelinenumber) | | [`code.namespace`](./code.md#codenamespace) | [`code.function.name`](./code.md#codefunctionname) | +| [`connection.rtt`](./connection.md#connectionrtt) | [`browser.connection.rtt`](./browser.md#browserconnectionrtt) | | [`db.name`](./db.md#dbname) | [`db.namespace`](./db.md#dbnamespace) | | [`db.operation`](./db.md#dboperation) | [`db.operation.name`](./db.md#dboperationname) | | [`db.sql.bindings`](./db.md#dbsqlbindings) | [`db.query.parameter.\`](./db.md#dbqueryparameterkey) | diff --git a/generated/attributes/browser.md b/generated/attributes/browser.md index 2295102b..3dbb827e 100644 --- a/generated/attributes/browser.md +++ b/generated/attributes/browser.md @@ -3,6 +3,7 @@ # Browser Attributes - [Stable Attributes](#stable-attributes) + - [browser.connection.rtt](#browserconnectionrtt) - [browser.name](#browsername) - [browser.report.type](#browserreporttype) - [browser.script.invoker](#browserscriptinvoker) @@ -12,6 +13,18 @@ ## Stable Attributes +### browser.connection.rtt + +The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds. + +| Property | Value | +| --- | --- | +| Type | `integer` | +| Has PII | maybe | +| Exists in OpenTelemetry | No | +| Example | `50` | +| Aliases | `connection.rtt` | + ### browser.name The name of the browser. diff --git a/generated/attributes/connection.md b/generated/attributes/connection.md new file mode 100644 index 00000000..27c4de94 --- /dev/null +++ b/generated/attributes/connection.md @@ -0,0 +1,25 @@ + + +# Connection Attributes + +- [Deprecated Attributes](#deprecated-attributes) + - [connection.rtt](#connectionrtt) + +## Deprecated Attributes + +These attributes are deprecated and will be removed in a future version. Please use the recommended replacements. + +### connection.rtt + +The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds. + +| Property | Value | +| --- | --- | +| Type | `integer` | +| Has PII | maybe | +| Exists in OpenTelemetry | No | +| Example | `50` | +| Deprecated | Yes, use `browser.connection.rtt` instead | +| Deprecation Reason | This attribute is being deprecated in favor of browser.connection.rtt | +| Aliases | `browser.connection.rtt` | + diff --git a/generated/attributes/index.md b/generated/attributes/index.md index 42ed24fd..9ff01fbc 100644 --- a/generated/attributes/index.md +++ b/generated/attributes/index.md @@ -14,6 +14,7 @@ This directory contains documentation for all available attributes. - [`client` Attributes](./client.md) - [`cloudflare` Attributes](./cloudflare.md) - [`code` Attributes](./code.md) +- [`connection` Attributes](./connection.md) - [`db` Attributes](./db.md) - [`device` Attributes](./device.md) - [`error` Attributes](./error.md) diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index a5b7272d..d101605f 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -754,6 +754,28 @@ export const BLOCKED_MAIN_THREAD = 'blocked_main_thread'; */ export type BLOCKED_MAIN_THREAD_TYPE = boolean; +// Path: model/attributes/browser/browser__connection__rtt.json + +/** + * The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds. `browser.connection.rtt` + * + * Attribute Value Type: `number` {@link BROWSER_CONNECTION_RTT_TYPE} + * + * Contains PII: maybe + * + * Attribute defined in OTEL: No + * + * Aliases: {@link CONNECTION_RTT} `connection.rtt` + * + * @example 50 + */ +export const BROWSER_CONNECTION_RTT = 'browser.connection.rtt'; + +/** + * Type for {@link BROWSER_CONNECTION_RTT} browser.connection.rtt + */ +export type BROWSER_CONNECTION_RTT_TYPE = number; + // Path: model/attributes/browser/browser__name.json /** @@ -1256,6 +1278,29 @@ export const CODE_NAMESPACE = 'code.namespace'; */ export type CODE_NAMESPACE_TYPE = string; +// Path: model/attributes/connection/connection__rtt.json + +/** + * The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds. `connection.rtt` + * + * Attribute Value Type: `number` {@link CONNECTION_RTT_TYPE} + * + * Contains PII: maybe + * + * Attribute defined in OTEL: No + * + * Aliases: {@link BROWSER_CONNECTION_RTT} `browser.connection.rtt` + * + * @deprecated Use {@link BROWSER_CONNECTION_RTT} (browser.connection.rtt) instead - This attribute is being deprecated in favor of browser.connection.rtt + * @example 50 + */ +export const CONNECTION_RTT = 'connection.rtt'; + +/** + * Type for {@link CONNECTION_RTT} connection.rtt + */ +export type CONNECTION_RTT_TYPE = number; + // Path: model/attributes/db/db__collection__name.json /** @@ -8863,6 +8908,7 @@ export const ATTRIBUTE_TYPE: Record = { [AI_WARNINGS]: 'string[]', [APP_START_TYPE]: 'string', [BLOCKED_MAIN_THREAD]: 'boolean', + [BROWSER_CONNECTION_RTT]: 'integer', [BROWSER_NAME]: 'string', [BROWSER_REPORT_TYPE]: 'string', [BROWSER_SCRIPT_INVOKER]: 'string', @@ -8887,6 +8933,7 @@ export const ATTRIBUTE_TYPE: Record = { [CODE_LINENO]: 'integer', [CODE_LINE_NUMBER]: 'integer', [CODE_NAMESPACE]: 'string', + [CONNECTION_RTT]: 'integer', [DB_COLLECTION_NAME]: 'string', [DB_NAME]: 'string', [DB_NAMESPACE]: 'string', @@ -9289,6 +9336,7 @@ export type AttributeName = | typeof AI_WARNINGS | typeof APP_START_TYPE | typeof BLOCKED_MAIN_THREAD + | typeof BROWSER_CONNECTION_RTT | typeof BROWSER_NAME | typeof BROWSER_REPORT_TYPE | typeof BROWSER_SCRIPT_INVOKER @@ -9313,6 +9361,7 @@ export type AttributeName = | typeof CODE_LINENO | typeof CODE_LINE_NUMBER | typeof CODE_NAMESPACE + | typeof CONNECTION_RTT | typeof DB_COLLECTION_NAME | typeof DB_NAME | typeof DB_NAMESPACE @@ -10085,6 +10134,18 @@ export const ATTRIBUTE_METADATA: Record = { isInOtel: false, example: true, }, + [BROWSER_CONNECTION_RTT]: { + brief: + "The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds.", + type: 'integer', + pii: { + isPii: 'maybe', + }, + isInOtel: false, + example: 50, + aliases: [CONNECTION_RTT], + sdks: ['javascript-browser'], + }, [BROWSER_NAME]: { brief: 'The name of the browser.', type: 'string', @@ -10340,6 +10401,21 @@ export const ATTRIBUTE_METADATA: Record = { reason: 'code.function.name should include the namespace.', }, }, + [CONNECTION_RTT]: { + brief: + "The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds.", + type: 'integer', + pii: { + isPii: 'maybe', + }, + isInOtel: false, + example: 50, + deprecation: { + replacement: 'browser.connection.rtt', + reason: 'This attribute is being deprecated in favor of browser.connection.rtt', + }, + aliases: [BROWSER_CONNECTION_RTT], + }, [DB_COLLECTION_NAME]: { brief: 'The name of a collection (table, container) within the database.', type: 'string', @@ -14051,6 +14127,7 @@ export type Attributes = { [AI_WARNINGS]?: AI_WARNINGS_TYPE; [APP_START_TYPE]?: APP_START_TYPE_TYPE; [BLOCKED_MAIN_THREAD]?: BLOCKED_MAIN_THREAD_TYPE; + [BROWSER_CONNECTION_RTT]?: BROWSER_CONNECTION_RTT_TYPE; [BROWSER_NAME]?: BROWSER_NAME_TYPE; [BROWSER_REPORT_TYPE]?: BROWSER_REPORT_TYPE_TYPE; [BROWSER_SCRIPT_INVOKER]?: BROWSER_SCRIPT_INVOKER_TYPE; @@ -14075,6 +14152,7 @@ export type Attributes = { [CODE_LINENO]?: CODE_LINENO_TYPE; [CODE_LINE_NUMBER]?: CODE_LINE_NUMBER_TYPE; [CODE_NAMESPACE]?: CODE_NAMESPACE_TYPE; + [CONNECTION_RTT]?: CONNECTION_RTT_TYPE; [DB_COLLECTION_NAME]?: DB_COLLECTION_NAME_TYPE; [DB_NAME]?: DB_NAME_TYPE; [DB_NAMESPACE]?: DB_NAMESPACE_TYPE; diff --git a/model/attributes/browser/browser__connection__rtt.json b/model/attributes/browser/browser__connection__rtt.json new file mode 100644 index 00000000..23d8444a --- /dev/null +++ b/model/attributes/browser/browser__connection__rtt.json @@ -0,0 +1,12 @@ +{ + "key": "browser.connection.rtt", + "brief": "The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds.", + "type": "integer", + "pii": { + "key": "maybe" + }, + "is_in_otel": false, + "example": 50, + "alias": ["connection.rtt"], + "sdks": ["javascript-browser"] +} diff --git a/model/attributes/connection/connection__rtt.json b/model/attributes/connection/connection__rtt.json new file mode 100644 index 00000000..15b5f8c7 --- /dev/null +++ b/model/attributes/connection/connection__rtt.json @@ -0,0 +1,16 @@ +{ + "key": "connection.rtt", + "brief": "The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds.", + "type": "integer", + "pii": { + "key": "maybe" + }, + "is_in_otel": false, + "example": 50, + "deprecation": { + "_status": "backfill", + "replacement": "browser.connection.rtt", + "reason": "This attribute is being deprecated in favor of browser.connection.rtt" + }, + "alias": ["browser.connection.rtt"] +} diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index b23bf47e..cd3db539 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -109,6 +109,7 @@ class _AttributeNamesMeta(type): "CODE_FUNCTION", "CODE_LINENO", "CODE_NAMESPACE", + "CONNECTION_RTT", "DB_NAME", "DB_OPERATION", "DB_SQL_BINDINGS", @@ -569,6 +570,17 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: true """ + # Path: model/attributes/browser/browser__connection__rtt.json + BROWSER_CONNECTION_RTT: Literal["browser.connection.rtt"] = "browser.connection.rtt" + """The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds. + + Type: int + Contains PII: maybe + Defined in OTEL: No + Aliases: connection.rtt + Example: 50 + """ + # Path: model/attributes/browser/browser__name.json BROWSER_NAME: Literal["browser.name"] = "browser.name" """The name of the browser. @@ -830,6 +842,18 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: "http.handler" """ + # Path: model/attributes/connection/connection__rtt.json + CONNECTION_RTT: Literal["connection.rtt"] = "connection.rtt" + """The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds. + + Type: int + Contains PII: maybe + Defined in OTEL: No + Aliases: browser.connection.rtt + DEPRECATED: Use browser.connection.rtt instead - This attribute is being deprecated in favor of browser.connection.rtt + Example: 50 + """ + # Path: model/attributes/db/db__collection__name.json DB_COLLECTION_NAME: Literal["db.collection.name"] = "db.collection.name" """The name of a collection (table, container) within the database. @@ -5120,6 +5144,15 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): is_in_otel=False, example=True, ), + "browser.connection.rtt": AttributeMetadata( + brief="The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds.", + type=AttributeType.INTEGER, + pii=PiiInfo(isPii=IsPii.MAYBE), + is_in_otel=False, + example=50, + aliases=["connection.rtt"], + sdks=["javascript-browser"], + ), "browser.name": AttributeMetadata( brief="The name of the browser.", type=AttributeType.STRING, @@ -5315,6 +5348,19 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): reason="code.function.name should include the namespace.", ), ), + "connection.rtt": AttributeMetadata( + brief="The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds.", + type=AttributeType.INTEGER, + pii=PiiInfo(isPii=IsPii.MAYBE), + is_in_otel=False, + example=50, + deprecation=DeprecationInfo( + replacement="browser.connection.rtt", + reason="This attribute is being deprecated in favor of browser.connection.rtt", + status=DeprecationStatus.BACKFILL, + ), + aliases=["browser.connection.rtt"], + ), "db.collection.name": AttributeMetadata( brief="The name of a collection (table, container) within the database.", type=AttributeType.STRING, @@ -8169,6 +8215,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "ai.warnings": List[str], "app_start_type": str, "blocked_main_thread": bool, + "browser.connection.rtt": int, "browser.name": str, "browser.report.type": str, "browser.script.invoker": str, @@ -8193,6 +8240,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "code.line.number": int, "code.lineno": int, "code.namespace": str, + "connection.rtt": int, "db.collection.name": str, "db.name": str, "db.namespace": str, diff --git a/shared/deprecated_attributes.json b/shared/deprecated_attributes.json index f02695e3..ec0dab70 100644 --- a/shared/deprecated_attributes.json +++ b/shared/deprecated_attributes.json @@ -504,6 +504,22 @@ "reason": "code.function.name should include the namespace." } }, + { + "key": "connection.rtt", + "brief": "The estimated request round trip time (RTT) in milliseconds based on the current connection's quality. Values are always multiples of 25 milliseconds.", + "type": "integer", + "pii": { + "key": "maybe" + }, + "is_in_otel": false, + "example": 50, + "deprecation": { + "_status": "backfill", + "replacement": "browser.connection.rtt", + "reason": "This attribute is being deprecated in favor of browser.connection.rtt" + }, + "alias": ["browser.connection.rtt"] + }, { "key": "db.name", "brief": "The name of the database being accessed.",