Skip to content

Commit 4882239

Browse files
authored
feat(otel): set vercel.deployment_id as a resource attribute (#102)
1 parent bdaa6c9 commit 4882239

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎.changeset/calm-geese-peel.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vercel/otel": minor
3+
---
4+
5+
Set vercel.deployment_id as a resource attribute

‎packages/otel/src/sdk.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ export class Sdk {
117117
process.env.VERCEL_BRANCH_URL ||
118118
process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL ||
119119
undefined,
120+
"vercel.deployment_id":
121+
process.env.VERCEL_DEPLOYMENT_ID ||
122+
undefined,
120123
[SemanticResourceAttributes.SERVICE_VERSION]: process.env.VERCEL_DEPLOYMENT_ID,
121124

122125
...configuration.attributes,

‎packages/otel/src/types.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export interface Configuration {
7373
* - `vercel.sha` - the Vercel deployment Git SHA (`VERCEL_GIT_COMMIT_SHA` environment variable).
7474
* - `vercel.host` - the Vercel deployment host for the Git SHA (`VERCEL_URL` environment variable).
7575
* - `vercel.branch_host` - the Vercel deployment host for the branch (`VERCEL_BRANCH_URL` environment variable).
76+
* - `vercel.deployment_id` - the Vercel deployment ID (`VERCEL_DEPLOYMENT_ID` environment variable).
7677
*
7778
* Any additional attributes will be merged with the default attributes.
7879
*/

0 commit comments

Comments
 (0)