From f22a0d7d6fd127b1bd5ca7dcdf9e213e7091d7ed Mon Sep 17 00:00:00 2001 From: Gaspar Garcia Date: Wed, 20 Mar 2024 20:03:24 -0700 Subject: [PATCH] Clarify the behavior of the attributes field on registerOTel function --- .changeset/strange-papayas-battle.md | 5 +++++ packages/otel/README.md | 2 +- packages/otel/src/types.ts | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/strange-papayas-battle.md diff --git a/.changeset/strange-papayas-battle.md b/.changeset/strange-papayas-battle.md new file mode 100644 index 0000000..1f81f9e --- /dev/null +++ b/.changeset/strange-papayas-battle.md @@ -0,0 +1,5 @@ +--- +"@vercel/otel": patch +--- + +Update documentation diff --git a/packages/otel/README.md b/packages/otel/README.md index 8de3841..c5fe076 100644 --- a/packages/otel/README.md +++ b/packages/otel/README.md @@ -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: diff --git a/packages/otel/src/types.ts b/packages/otel/src/types.ts index 8c31c07..22b0e84 100644 --- a/packages/otel/src/types.ts +++ b/packages/otel/src/types.ts @@ -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: @@ -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;