Skip to content

feat(instrumentation): Add deployment metadata to telemetry#578

Merged
dcramer merged 4 commits into
mainfrom
add-vercel-deployment-span-attrs
Jun 10, 2026
Merged

feat(instrumentation): Add deployment metadata to telemetry#578
dcramer merged 4 commits into
mainfrom
add-vercel-deployment-span-attrs

Conversation

@dcramer

@dcramer dcramer commented Jun 9, 2026

Copy link
Copy Markdown
Member

Sentry span export and Junior log records now attach the same normalized Vercel deployment metadata. A shared root helper emits deployment.id from VERCEL_DEPLOYMENT_ID and service.version from SENTRY_RELEASE, falling back to VERCEL_GIT_COMMIT_SHA when the release is blank or unset. Deployment identity is applied centrally and wins over event-local span or log attributes so each telemetry record stays tied to the emitting deployment.

The telemetry specs now list deployment.id for tracing and logging, and specs/instrumentation.md documents the scope rule: global process/deployment attributes may be repeated on every span/log, while operation-local facts such as HTTP status codes stay on the span or log record that observed them.

Validated with targeted span/log unit tests, package typecheck, the chat dependency boundary check, and the package build.

Attach the Vercel deployment ID and release version to every outgoing Sentry span so traces can be filtered by the exact deployment that emitted them.

Document deployment.id in the tracing semantics specs alongside the existing deployment environment metadata.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jun 9, 2026 3:08pm

Request Review

@dcramer

dcramer commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

seems silly to put it on all spans but tracing is silly by design so 🤷

Share Vercel deployment telemetry attributes between span enrichment and the logging facade so emitted log records carry the same deployment.id and service.version values.

Cover the logging attribute contract with a focused unit test.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
@dcramer dcramer changed the title feat(instrumentation): Add deployment metadata to spans feat(instrumentation): Add deployment metadata to telemetry Jun 9, 2026
@dcramer dcramer marked this pull request as ready for review June 9, 2026 14:40
Normalize deployment telemetry env values before emitting them on spans and logs. Keep deployment metadata authoritative over event-local log attributes, move the shared helper out of chat ownership, and document the logging contract.

Add focused span enrichment coverage alongside the log record test.

Co-Authored-By: GPT-5 Codex <codex@openai.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c4012ac. Configure here.

Comment thread packages/junior/src/instrumentation.ts
Use the existing deployment module for deployment telemetry helpers instead of a standalone telemetry module.

Normalize the Sentry release value with the same deployment service version used on spans and logs so blank releases fall back to the Vercel commit SHA consistently.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
@dcramer dcramer merged commit 431a624 into main Jun 10, 2026
16 checks passed
@dcramer dcramer deleted the add-vercel-deployment-span-attrs branch June 10, 2026 19:56
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.

1 participant