feat(attributes): Add file.path and file.size#458
Open
buenaflor wants to merge 3 commits into
Open
Conversation
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) <noreply@anthropic.com>
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
🤖 This preview updates automatically when you update the PR. |
file.path and file.size
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds two OpenTelemetry-aligned attributes in the file namespace—file.path and file.size—to the Sentry conventions registry and generated language bindings, reusing OTel names/types and marking them as is_in_otel: true.
Changes:
- Added
file.pathandfile.sizeto the Python attribute name constants, metadata registry, and typed attribute mapping. - Added
file.pathandfile.sizeto the JavaScript/TypeScript constants, types, metadata registry, and attribute-type mapping. - Introduced the corresponding source-of-truth JSON model definitions under
model/attributes/file/.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/src/sentry_conventions/attributes.py | Adds Python constants, metadata, and typing entries for file.path / file.size. |
| model/attributes/file/file__path.json | Defines file.path in the registry model (type, scrubbing, example, changelog). |
| model/attributes/file/file__size.json | Defines file.size in the registry model (type, scrubbing, example, changelog). |
| javascript/sentry-conventions/src/attributes.ts | Adds TS constants/types plus metadata and type maps for file.path / file.size. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mjq
approved these changes
Jun 30, 2026
Lms24
reviewed
Jul 1, 2026
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) <noreply@anthropic.com>
Lms24
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the OTel-aligned
file.pathandfile.sizeattributes to thefilenamespace.Both attributes are already defined in the OpenTelemetry semantic conventions registry, so per the contributing guidelines we reuse the OTel names and types rather than introducing Sentry-specific synonyms, and set
is_in_otel: true.file.path—string, e.g./home/user/example.txtfile.size—integer(bytes), e.g.1024