Skip to content

fix(otel): add VCS resource attributes#193

Merged
kakadiadarpan merged 9 commits into
mainfrom
darpan/fix-otel-resource-attrs
Apr 8, 2026
Merged

fix(otel): add VCS resource attributes#193
kakadiadarpan merged 9 commits into
mainfrom
darpan/fix-otel-resource-attrs

Conversation

@kakadiadarpan
Copy link
Copy Markdown
Collaborator

Problem

  • Default resource attributes were missing VCS metadata described in the OpenTelemetry semantic conventions here

Solution

  • add the missing VCS resource attributes from the OpenTelemetry semantic conventions
  • keep existing resource attributes for compatibility
  • move attribute helper utilities to src/util/attributes.ts
  • keep semantic attribute constants in src/semantic-resource-attributes.ts
  • mark DEPLOYMENT_ENVIRONMENT & VCS_REPOSITORY_REF_VERSION as deprecated
  • add tests

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 7, 2026

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

Project Deployment Actions Updated (UTC)
otel-site Ready Ready Preview, Comment, Open in v0 Apr 8, 2026 8:02am

@kakadiadarpan kakadiadarpan changed the title fix otel resource attr runtime and vcs metadata fix(otel): add VCS resource attributes Apr 7, 2026
Comment thread packages/otel/src/types.ts Outdated
…was removed from the code in commit 21cfac7.

This commit fixes the issue reported at packages/otel/src/types.ts:69

**Bug explanation:**

Commit 21cfac7 ("remove ref type attribute") correctly removed the `VCS_REF_TYPE` constant from `semantic-resource-attributes.ts`, its import and usage from `util/attributes.ts`, and its test assertion from `util/attributes.test.ts`. However, two documentation references were left behind:

1. `packages/otel/src/types.ts` line 69: The JSDoc comment for the `Configuration` interface still listed `vcs.ref.type` as a default resource attribute with the description "branch when the Vercel Git ref is available."
2. `packages/otel/README.md` line 50: The attributes documentation still included `vcs.ref.type` in the comma-separated list of default resource attributes.

This means the documentation tells users that `vcs.ref.type` will be emitted as a resource attribute, but the code no longer produces it. Users relying on this documented attribute would find it missing from their telemetry data.

**Fix explanation:**

- Removed the `vcs.ref.type` bullet point from the JSDoc comment in `types.ts`.
- Removed `vcs.ref.type` from the comma-separated attribute list in `README.md`.

Both documentation sections now accurately reflect the set of default resource attributes actually emitted by the code.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: kakadiadarpan <hey@kakadiadarpan.com>
@kakadiadarpan kakadiadarpan merged commit 937e29a into main Apr 8, 2026
8 checks passed
@kakadiadarpan kakadiadarpan deleted the darpan/fix-otel-resource-attrs branch April 8, 2026 09:24
@github-actions github-actions Bot mentioned this pull request Apr 8, 2026
kakadiadarpan added a commit that referenced this pull request Apr 8, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/otel@2.1.2

### Patch Changes

- [#193](#193)
[`937e29a`](937e29a)
Thanks [@kakadiadarpan](https://github.com/kakadiadarpan)! - Add
standard OpenTelemetry resource attributes for VCS.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Darpan Kakadia <kakadiadarpan@gmail.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.

2 participants