Skip to content

feat(attributes): Add file.path and file.size#458

Open
buenaflor wants to merge 3 commits into
mainfrom
feat/file-path-size-attributes
Open

feat(attributes): Add file.path and file.size#458
buenaflor wants to merge 3 commits into
mainfrom
feat/file-path-size-attributes

Conversation

@buenaflor

@buenaflor buenaflor commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Add the OTel-aligned file.path and file.size attributes to the file namespace.

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.pathstring, e.g. /home/user/example.txt
  • file.sizeinteger (bytes), e.g. 1024

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>
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (ai) Add granular cost attributes for cache and reasoning by vgrozdanic in #461
  • (attributes) Add file.path and file.size by buenaflor in #458

🤖 This preview updates automatically when you update the PR.

@buenaflor buenaflor marked this pull request as ready for review June 30, 2026 14:09
@buenaflor buenaflor requested review from Lms24, cleptric and mjq as code owners June 30, 2026 14:09
Copilot AI review requested due to automatic review settings June 30, 2026 14:09
@buenaflor buenaflor requested review from a team and nsdeschenes as code owners June 30, 2026 14:09
@buenaflor buenaflor changed the title feat(attributes): Add file.path and file.size feat(attributes): Add file.path and file.size Jun 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.path and file.size to the Python attribute name constants, metadata registry, and typed attribute mapping.
  • Added file.path and file.size to 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.

Comment thread model/attributes/file/file__path.json Outdated
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants