From b4668847633c1cd71de5da8cf4450d2efa13f8c7 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Tue, 30 Jun 2026 16:05:34 +0200 Subject: [PATCH 1/2] feat(attributes): Add file.path and file.size Add the OTel-aligned `file.path` and `file.size` attributes to the `file` namespace. Both are defined in the OpenTelemetry semantic conventions registry, so we reuse the OTel names and types and set is_in_otel: true. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../sentry-conventions/src/attributes.ts | 70 +++++++++++++++++++ model/attributes/file/file__path.json | 18 +++++ model/attributes/file/file__size.json | 18 +++++ python/src/sentry_conventions/attributes.py | 50 +++++++++++++ 4 files changed, 156 insertions(+) create mode 100644 model/attributes/file/file__path.json create mode 100644 model/attributes/file/file__size.json diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 28e62d02..a96da20f 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -5193,6 +5193,48 @@ export const FCP = 'fcp'; */ export type FCP_TYPE = number; +// Path: model/attributes/file/file__path.json + +/** + * Path to the file. `file.path` + * + * Attribute Value Type: `string` {@link FILE_PATH_TYPE} + * + * Apply Scrubbing: manual + * + * Attribute defined in OTEL: Yes + * Visibility: public + * + * @example "/home/user/example.txt" + */ +export const FILE_PATH = 'file.path'; + +/** + * Type for {@link FILE_PATH} file.path + */ +export type FILE_PATH_TYPE = string; + +// Path: model/attributes/file/file__size.json + +/** + * File size in bytes. `file.size` + * + * Attribute Value Type: `number` {@link FILE_SIZE_TYPE} + * + * Apply Scrubbing: manual + * + * Attribute defined in OTEL: Yes + * Visibility: public + * + * @example 1024 + */ +export const FILE_SIZE = 'file.size'; + +/** + * Type for {@link FILE_SIZE} file.size + */ +export type FILE_SIZE_TYPE = number; + // Path: model/attributes/flag/flag__evaluation__[key].json /** @@ -14995,6 +15037,8 @@ export const ATTRIBUTE_TYPE: Record = { 'faas.trigger': 'string', 'faas.version': 'string', fcp: 'double', + 'file.path': 'string', + 'file.size': 'integer', 'flag.evaluation.': 'boolean', fp: 'double', 'frames.delay': 'integer', @@ -15666,6 +15710,8 @@ export type AttributeName = | typeof FAAS_TRIGGER | typeof FAAS_VERSION | typeof FCP + | typeof FILE_PATH + | typeof FILE_SIZE | typeof FLAG_EVALUATION_KEY | typeof FP | typeof FRAMES_DELAY @@ -19191,6 +19237,28 @@ export const ATTRIBUTE_METADATA: Record = { aliases: ['browser.web_vital.fcp.value'], changelog: [{ version: '0.5.0', prs: [235] }], }, + 'file.path': { + brief: 'Path to the file.', + type: 'string', + applyScrubbing: { + key: 'manual', + }, + isInOtel: true, + visibility: 'public', + example: '/home/user/example.txt', + changelog: [{ version: 'next', prs: [458], description: 'Added file.path attribute' }], + }, + 'file.size': { + brief: 'File size in bytes.', + type: 'integer', + applyScrubbing: { + key: 'manual', + }, + isInOtel: true, + visibility: 'public', + example: 1024, + changelog: [{ version: 'next', prs: [458], description: 'Added file.size attribute' }], + }, 'flag.evaluation.': { brief: 'An instance of a feature flag evaluation. The value of this attribute is the boolean representing the evaluation result. The suffix is the name of the feature flag.', @@ -25184,6 +25252,8 @@ export type Attributes = { [FAAS_TRIGGER]?: FAAS_TRIGGER_TYPE; [FAAS_VERSION]?: FAAS_VERSION_TYPE; [FCP]?: FCP_TYPE; + [FILE_PATH]?: FILE_PATH_TYPE; + [FILE_SIZE]?: FILE_SIZE_TYPE; [FLAG_EVALUATION_KEY]?: FLAG_EVALUATION_KEY_TYPE; [FP]?: FP_TYPE; [FRAMES_DELAY]?: FRAMES_DELAY_TYPE; diff --git a/model/attributes/file/file__path.json b/model/attributes/file/file__path.json new file mode 100644 index 00000000..008de95f --- /dev/null +++ b/model/attributes/file/file__path.json @@ -0,0 +1,18 @@ +{ + "key": "file.path", + "brief": "Path to the file.", + "type": "string", + "apply_scrubbing": { + "key": "manual" + }, + "is_in_otel": true, + "visibility": "public", + "example": "/home/user/example.txt", + "changelog": [ + { + "version": "next", + "prs": [458], + "description": "Added file.path attribute" + } + ] +} diff --git a/model/attributes/file/file__size.json b/model/attributes/file/file__size.json new file mode 100644 index 00000000..3e088d97 --- /dev/null +++ b/model/attributes/file/file__size.json @@ -0,0 +1,18 @@ +{ + "key": "file.size", + "brief": "File size in bytes.", + "type": "integer", + "apply_scrubbing": { + "key": "manual" + }, + "is_in_otel": true, + "visibility": "public", + "example": 1024, + "changelog": [ + { + "version": "next", + "prs": [458], + "description": "Added file.size attribute" + } + ] +} diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index c410a509..03289deb 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -3179,6 +3179,28 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: 547.6951 """ + # Path: model/attributes/file/file__path.json + FILE_PATH: Literal["file.path"] = "file.path" + """Path to the file. + + Type: str + Apply Scrubbing: manual + Defined in OTEL: Yes + Visibility: public + Example: "/home/user/example.txt" + """ + + # Path: model/attributes/file/file__size.json + FILE_SIZE: Literal["file.size"] = "file.size" + """File size in bytes. + + Type: int + Apply Scrubbing: manual + Defined in OTEL: Yes + Visibility: public + Example: 1024 + """ + # Path: model/attributes/flag/flag__evaluation__[key].json FLAG_EVALUATION_KEY: Literal["flag.evaluation."] = "flag.evaluation." """An instance of a feature flag evaluation. The value of this attribute is the boolean representing the evaluation result. The suffix is the name of the feature flag. @@ -11886,6 +11908,32 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ChangelogEntry(version="0.5.0", prs=[235]), ], ), + "file.path": AttributeMetadata( + brief="Path to the file.", + type=AttributeType.STRING, + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + is_in_otel=True, + visibility=Visibility.PUBLIC, + example="/home/user/example.txt", + changelog=[ + ChangelogEntry( + version="next", prs=[458], description="Added file.path attribute" + ), + ], + ), + "file.size": AttributeMetadata( + brief="File size in bytes.", + type=AttributeType.INTEGER, + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + is_in_otel=True, + visibility=Visibility.PUBLIC, + example=1024, + changelog=[ + ChangelogEntry( + version="next", prs=[458], description="Added file.size attribute" + ), + ], + ), "flag.evaluation.": AttributeMetadata( brief="An instance of a feature flag evaluation. The value of this attribute is the boolean representing the evaluation result. The suffix is the name of the feature flag.", type=AttributeType.BOOLEAN, @@ -18125,6 +18173,8 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "faas.trigger": str, "faas.version": str, "fcp": float, + "file.path": str, + "file.size": int, "flag.evaluation.": bool, "fp": float, "frames.delay": int, From dc0dc54a219782e8c4b780ac661d6ff586728e6d Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 1 Jul 2026 11:21:31 +0200 Subject: [PATCH 2/2] ref(attributes): Set file.path scrubbing to auto File paths can contain end-user paths (e.g. from stack traces) that may be sensitive, so default to auto-scrubbing. Consistent with mcp.resource.uri and mcp.request.argument.uri, which auto-scrub for the same reason. Co-Authored-By: Claude Opus 4.8 (1M context) --- javascript/sentry-conventions/src/attributes.ts | 5 +++-- model/attributes/file/file__path.json | 3 ++- python/src/sentry_conventions/attributes.py | 7 +++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index a96da20f..ce0daa7a 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -5200,7 +5200,7 @@ export type FCP_TYPE = number; * * Attribute Value Type: `string` {@link FILE_PATH_TYPE} * - * Apply Scrubbing: manual + * Apply Scrubbing: auto - File paths can contain end-user paths (e.g. from stack traces) that may be sensitive. * * Attribute defined in OTEL: Yes * Visibility: public @@ -19241,7 +19241,8 @@ export const ATTRIBUTE_METADATA: Record = { brief: 'Path to the file.', type: 'string', applyScrubbing: { - key: 'manual', + key: 'auto', + reason: 'File paths can contain end-user paths (e.g. from stack traces) that may be sensitive.', }, isInOtel: true, visibility: 'public', diff --git a/model/attributes/file/file__path.json b/model/attributes/file/file__path.json index 008de95f..2df68448 100644 --- a/model/attributes/file/file__path.json +++ b/model/attributes/file/file__path.json @@ -3,7 +3,8 @@ "brief": "Path to the file.", "type": "string", "apply_scrubbing": { - "key": "manual" + "key": "auto", + "reason": "File paths can contain end-user paths (e.g. from stack traces) that may be sensitive." }, "is_in_otel": true, "visibility": "public", diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 03289deb..d8fbbae4 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -3184,7 +3184,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """Path to the file. Type: str - Apply Scrubbing: manual + Apply Scrubbing: auto - File paths can contain end-user paths (e.g. from stack traces) that may be sensitive. Defined in OTEL: Yes Visibility: public Example: "/home/user/example.txt" @@ -11911,7 +11911,10 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "file.path": AttributeMetadata( brief="Path to the file.", type=AttributeType.STRING, - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + apply_scrubbing=ApplyScrubbingInfo( + key=ApplyScrubbing.AUTO, + reason="File paths can contain end-user paths (e.g. from stack traces) that may be sensitive.", + ), is_in_otel=True, visibility=Visibility.PUBLIC, example="/home/user/example.txt",