Skip to content

Commit

Permalink
feat(otel): set vercel.deployment_id as a resource attribute (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
bripkens authored Aug 20, 2024
1 parent bdaa6c9 commit 4882239
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-geese-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vercel/otel": minor
---

Set vercel.deployment_id as a resource attribute
3 changes: 3 additions & 0 deletions packages/otel/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ export class Sdk {
process.env.VERCEL_BRANCH_URL ||
process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL ||
undefined,
"vercel.deployment_id":
process.env.VERCEL_DEPLOYMENT_ID ||
undefined,
[SemanticResourceAttributes.SERVICE_VERSION]: process.env.VERCEL_DEPLOYMENT_ID,

...configuration.attributes,
Expand Down
1 change: 1 addition & 0 deletions packages/otel/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export interface Configuration {
* - `vercel.sha` - the Vercel deployment Git SHA (`VERCEL_GIT_COMMIT_SHA` environment variable).
* - `vercel.host` - the Vercel deployment host for the Git SHA (`VERCEL_URL` environment variable).
* - `vercel.branch_host` - the Vercel deployment host for the branch (`VERCEL_BRANCH_URL` environment variable).
* - `vercel.deployment_id` - the Vercel deployment ID (`VERCEL_DEPLOYMENT_ID` environment variable).
*
* Any additional attributes will be merged with the default attributes.
*/
Expand Down

0 comments on commit 4882239

Please sign in to comment.