diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 283602d1..c90e9624 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -14564,6 +14564,30 @@ export const SENTRY_ACTION = 'sentry.action'; */ export type SENTRY_ACTION_TYPE = string; +// Path: model/attributes/sentry/sentry__app__url__domain.json + +/** + * The domain the instrumented app is running on. For browsers, that's the current window's url. For server-side applications, the domain the application is deployed on. Importantly, this attribute MUST NOT be used to describe urls of outgoing requests. `sentry.app.url.domain` + * + * Attribute Value Type: `string` {@link SENTRY_APP_URL_DOMAIN_TYPE} + * + * Apply Scrubbing: manual + * + * Attribute defined in OTEL: No + * Visibility: public + * + * @example "localhost" + * @example "api.project.com" + * @example "127.0.01" + * @example "::1" + */ +export const SENTRY_APP_URL_DOMAIN = 'sentry.app.url.domain'; + +/** + * Type for {@link SENTRY_APP_URL_DOMAIN} sentry.app.url.domain + */ +export type SENTRY_APP_URL_DOMAIN_TYPE = string; + // Path: model/attributes/sentry/sentry__browser__name.json /** @@ -19335,6 +19359,7 @@ export const ATTRIBUTE_TYPE: Record = { 'score.total': 'double', 'score.weight.': 'double', 'sentry.action': 'string', + 'sentry.app.url.domain': 'string', 'sentry.browser.name': 'string', 'sentry.browser.version': 'string', 'sentry.cancellation_reason': 'string', @@ -20171,6 +20196,7 @@ export type AttributeName = | typeof SCORE_TOTAL | typeof SCORE_WEIGHT_KEY | typeof SENTRY_ACTION + | typeof SENTRY_APP_URL_DOMAIN | typeof SENTRY_BROWSER_NAME | typeof SENTRY_BROWSER_VERSION | typeof SENTRY_CANCELLATION_REASON @@ -30739,6 +30765,26 @@ export const ATTRIBUTE_METADATA: Record = { name: 'span.action', }, }, + 'sentry.app.url.domain': { + brief: + "The domain the instrumented app is running on. For browsers, that's the current window's url. For server-side applications, the domain the application is deployed on. Importantly, this attribute MUST NOT be used to describe urls of outgoing requests.", + type: 'string', + keys: ['sentry.app.url.domain'], + applyScrubbing: { + key: 'manual', + }, + isInOtel: false, + visibility: 'public', + example: 'localhost', + examples: ['localhost', 'api.project.com', '127.0.01', '::1'], + changelog: [{ version: 'next', prs: [635], description: 'Added sentry.app.url.domain attribute' }], + additionalContext: [ + "This attribute exists to enable sending the app's domain on every span, regardless of span kind. Other, existing URL attributes are ambiguous and serve different purposes for spans describing incoming or outgoing requests.", + "This attribute is used for Sentry's Inbound filters, for example, to filter out telemetry emitted from localhost", + 'The attribute MAY carry an IP address, if a resolved domain name is not available.', + "To avoid conflicts with OTel's definition of the `app` namespace, this attribute is prefixed with `sentry.`", + ], + }, 'sentry.browser.name': { brief: 'The name of the browser.', type: 'string', @@ -34128,6 +34174,7 @@ export type Attributes = { [SCORE_TOTAL]?: SCORE_TOTAL_TYPE; [SCORE_WEIGHT_KEY]?: SCORE_WEIGHT_KEY_TYPE; [SENTRY_ACTION]?: SENTRY_ACTION_TYPE; + [SENTRY_APP_URL_DOMAIN]?: SENTRY_APP_URL_DOMAIN_TYPE; [SENTRY_BROWSER_NAME]?: SENTRY_BROWSER_NAME_TYPE; [SENTRY_BROWSER_VERSION]?: SENTRY_BROWSER_VERSION_TYPE; [SENTRY_CANCELLATION_REASON]?: SENTRY_CANCELLATION_REASON_TYPE; diff --git a/javascript/sentry-conventions/src/search.ts b/javascript/sentry-conventions/src/search.ts index 2863072e..ebff06e4 100644 --- a/javascript/sentry-conventions/src/search.ts +++ b/javascript/sentry-conventions/src/search.ts @@ -3739,6 +3739,11 @@ export const SEARCH_SDK__VERSION = 'sdk.version'; */ export const SEARCH_SENTRY__ACTION = 'sentry.action'; +/** + * Search name for {@link attributes.SENTRY_APP_URL_DOMAIN}. `sentry.app.url.domain` + */ +export const SEARCH_SENTRY__APP__URL__DOMAIN = 'sentry.app.url.domain'; + /** * Search name for {@link attributes.SENTRY_BROWSER_VERSION}. `sentry.browser.version` * @@ -5466,6 +5471,7 @@ export type AttributeSearchName = | typeof SEARCH_SDK__NAME | typeof SEARCH_SDK__VERSION | typeof SEARCH_SENTRY__ACTION + | typeof SEARCH_SENTRY__APP__URL__DOMAIN | typeof SEARCH_SENTRY__BROWSER__VERSION | typeof SEARCH_SENTRY__CANCELLATION_REASON | typeof SEARCH_SENTRY__CATEGORY @@ -9878,6 +9884,13 @@ export const ATTRIBUTE_SEARCH_METADATA: Record brief: 'The sentry sdk version.', deprecationChain: ['sentry.sdk.version', 'sdk.version'], }, + 'sentry.app.url.domain': { + canonicalName: 'sentry.app.url.domain', + type: 'string', + brief: + "The domain the instrumented app is running on. For browsers, that's the current window's url. For server-side applications, the domain the application is deployed on. Importantly, this attribute MUST NOT be used to describe urls of outgoing requests.", + deprecationChain: ['sentry.app.url.domain'], + }, 'sentry.browser.version': { canonicalName: 'browser.version', type: 'string', diff --git a/model/attributes/sentry/sentry__app__url__domain.json b/model/attributes/sentry/sentry__app__url__domain.json new file mode 100644 index 00000000..41a2bb62 --- /dev/null +++ b/model/attributes/sentry/sentry__app__url__domain.json @@ -0,0 +1,24 @@ +{ + "key": "sentry.app.url.domain", + "brief": "The domain the instrumented app is running on. For browsers, that's the current window's url. For server-side applications, the domain the application is deployed on. Importantly, this attribute MUST NOT be used to describe urls of outgoing requests.", + "additional_context": [ + "This attribute exists to enable sending the app's domain on every span, regardless of span kind. Other, existing URL attributes are ambiguous and serve different purposes for spans describing incoming or outgoing requests.", + "This attribute is used for Sentry's Inbound filters, for example, to filter out telemetry emitted from localhost", + "The attribute MAY carry an IP address, if a resolved domain name is not available.", + "To avoid conflicts with OTel's definition of the `app` namespace, this attribute is prefixed with `sentry.`" + ], + "type": "string", + "apply_scrubbing": { + "key": "manual" + }, + "is_in_otel": false, + "visibility": "public", + "examples": ["localhost", "api.project.com", "127.0.01", "::1"], + "changelog": [ + { + "version": "next", + "prs": [635], + "description": "Added sentry.app.url.domain attribute" + } + ] +} diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 937fbd2c..42701dca 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -8588,6 +8588,20 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: "SELECT" """ + # Path: model/attributes/sentry/sentry__app__url__domain.json + SENTRY_APP_URL_DOMAIN: Literal["sentry.app.url.domain"] = "sentry.app.url.domain" + """The domain the instrumented app is running on. For browsers, that's the current window's url. For server-side applications, the domain the application is deployed on. Importantly, this attribute MUST NOT be used to describe urls of outgoing requests. + + Type: str + Apply Scrubbing: manual + Defined in OTEL: No + Visibility: public + Example: "localhost" + Example: "api.project.com" + Example: "127.0.01" + Example: "::1" + """ + # Path: model/attributes/sentry/sentry__browser__name.json SENTRY_BROWSER_NAME: Literal["sentry.browser.name"] = "sentry.browser.name" """The name of the browser. @@ -23101,6 +23115,29 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ], search_alias=SearchAlias(name="span.action"), ), + "sentry.app.url.domain": AttributeMetadata( + brief="The domain the instrumented app is running on. For browsers, that's the current window's url. For server-side applications, the domain the application is deployed on. Importantly, this attribute MUST NOT be used to describe urls of outgoing requests.", + type=AttributeType.STRING, + keys=("sentry.app.url.domain",), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + is_in_otel=False, + visibility=Visibility.PUBLIC, + example="localhost", + examples=["localhost", "api.project.com", "127.0.01", "::1"], + changelog=[ + ChangelogEntry( + version="next", + prs=[635], + description="Added sentry.app.url.domain attribute", + ), + ], + additional_context=[ + "This attribute exists to enable sending the app's domain on every span, regardless of span kind. Other, existing URL attributes are ambiguous and serve different purposes for spans describing incoming or outgoing requests.", + "This attribute is used for Sentry's Inbound filters, for example, to filter out telemetry emitted from localhost", + "The attribute MAY carry an IP address, if a resolved domain name is not available.", + "To avoid conflicts with OTel's definition of the `app` namespace, this attribute is prefixed with `sentry.`", + ], + ), "sentry.browser.name": AttributeMetadata( brief="The name of the browser.", type=AttributeType.STRING, @@ -26792,6 +26829,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "score.total": float, "score.weight.": float, "sentry.action": str, + "sentry.app.url.domain": str, "sentry.browser.name": str, "sentry.browser.version": str, "sentry.cancellation_reason": str,