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/CHANGELOG.md b/packages/otel/CHANGELOG.md index 182a307..b27a07c 100644 --- a/packages/otel/CHANGELOG.md +++ b/packages/otel/CHANGELOG.md @@ -81,7 +81,7 @@ - 2daf631: - Support for Node and Edge environments - Telemetry context propagation, including [W3C Trace Context](https://www.w3.org/TR/trace-context/) - Fetch API instrumentation with context propagation. - - Support and auto-configuration for [Vercel OTEL collector](https://vercel.com/docs/observability/otel-overview/quickstart). + - Support and auto-configuration for [Vercel OTEL collector](https://vercel.com/docs/observability/otel-overview). - Enhanced metadata reporting. - Sampling support. - Custom tracing exporter support. diff --git a/packages/otel/README.md b/packages/otel/README.md index 8de3841..abb2b39 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: @@ -62,7 +62,7 @@ Registers the OpenTelemetry SDK with the specified configuration. Configuration - `attributes: Attributes`: overrides the computed attributes for this call. - `propagators`: A set of propagators that may extend inbound and outbound contexts. By default, `@vercel/otel` configures [W3C Trace Context](https://www.w3.org/TR/trace-context/) propagator. - `traceSampler`: The sampler to be used to decide which requests should be traced. By default, all requests are traced. This option can be changed to, for instance, only trace 1% of all requests. -- `spanProcessors` and `traceExporter`: The export mechanism for traces. By default, `@vercel/otel` configures the best export mechanism for the environment. For instance, if a [tracing integrations](https://vercel.com/docs/observability/otel-overview/quickstart) is configured on Vercel, this integration will be automatically used for export; otherwise an [OTLP exporter](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#otlp-exporter) can be used if configured in environment variables. +- `spanProcessors` and `traceExporter`: The export mechanism for traces. By default, `@vercel/otel` configures the best export mechanism for the environment. For instance, if a [tracing integrations](https://vercel.com/docs/observability/otel-overview) is configured on Vercel, this integration will be automatically used for export; otherwise an [OTLP exporter](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#otlp-exporter) can be used if configured in environment variables. See [API](https://otel.vercel.sh/api/) for more details. @@ -75,7 +75,7 @@ See [CHANGELOG.md](https://otel.vercel.sh/CHANGELOG.md). - [OpenTelemetry Primer](https://opentelemetry.io/docs/concepts/observability-primer/) - [OpenTelemetry Environment Variables](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/) - [Next.js OpenTelemetry docs](https://nextjs.org/docs/app/building-your-application/optimizing/open-telemetry) -- [Vercel OpenTelemetry Collector](https://vercel.com/docs/observability/otel-overview/quickstart) +- [Vercel OpenTelemetry Collector](https://vercel.com/docs/observability/otel-overview) ## 📄 License diff --git a/packages/otel/src/types.ts b/packages/otel/src/types.ts index 8c31c07..01b4e32 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; @@ -120,7 +122,7 @@ export interface Configuration { * A custom exporter for traces. * Use the "auto" value to include the best export mechanism for the environment. * By default, `@vercel/otel` configures the best export mechanism for the - * environment. For instance, if a [tracing integrations](https://vercel.com/docs/observability/otel-overview/quickstart) is + * environment. For instance, if a [tracing integrations](https://vercel.com/docs/observability/otel-overview) is * configured on Vercel, this integration will be automatically used for export; otherwise an * [OTLP exporter](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#otlp-exporter) * can be used if configured via environment variables, such as `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_PROTOCOL`