Skip to content

Commit

Permalink
Clarify the behavior of the attributes field on registerOTel function
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspar09 committed Mar 21, 2024
1 parent cc4f6b0 commit f22a0d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/strange-papayas-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vercel/otel": patch
---

Update documentation
2 changes: 1 addition & 1 deletion packages/otel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Registers the OpenTelemetry SDK with the specified service name and the default
Registers the OpenTelemetry SDK with the specified configuration. Configuration options include:

- `serviceName`: The name of your service, used as the app name in many OpenTelemetry backends.
- `attributes`: The resource attributes. By default, `@vercel/otel` configures relevant Vercel attributes based on [the environment](https://vercel.com/docs/projects/environment-variables/system-environment-variables), such as `vercel.env`, `vercel.runtime`, `vercel.host`, etc.
- `attributes`: The resource attributes. By default, `@vercel/otel` configures relevant Vercel attributes based on [the environment](https://vercel.com/docs/projects/environment-variables/system-environment-variables), such as `vercel.env`, `vercel.runtime`, `vercel.host`, etc. The specified attributes are merged with default Vercel environment attributes.
- `instrumentations`: A set of instrumentations. By default, `@vercel/otel` configures "fetch" instrumentation.
- `instrumentationConfig`: Customize configuration for predefined instrumentations:
- `fetch`: Customize configuration of the predefined "fetch" instrumentation:
Expand Down
4 changes: 3 additions & 1 deletion packages/otel/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface Configuration {
serviceName?: string;

/**
* The resource attributes.
* The additional resource attributes to apply to all spans.
* By default, `@vercel/otel` configures relevant Vercel attributes based on the
* [environment](https://vercel.com/docs/projects/environment-variables/system-environment-variables),
* including:
Expand All @@ -68,6 +68,8 @@ 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).
*
* Any additional attributes will be merged with the default attributes.
*/
attributes?: ResourceAttributes;

Expand Down

0 comments on commit f22a0d7

Please sign in to comment.