@vercel/otel v1.8.2
š Vercel Otel
Note: This package is experimental. It doesn't follow semver yet. Minors can contain breaking changes.
@vercel/otel
is a simple and easy-to-use package that sets up your tracing configuration.
š” Use this package to quickly instrument your applications and get started with OpenTelemetry!
š¦ Installation
npm install @vercel/otel
š Usage
import { registerOTel } from "@vercel/otel";
import { trace } from "@opentelemetry/api";
// Register the OpenTelemetry.
registerOTel("your-service-name");
// Now you can use the OpenTelemetry APIs
const span = trace.getTracer("your-component").startSpan("your-operation");
š API Reference
registerOTel(serviceName: string)
Registers the OpenTelemetry SDK with the specified service name and the default configuration.
serviceName
: The name of your service, used as the app name in many OpenTelemetry backends.
registerOTel(config: Configuration)
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, such asvercel.env
,vercel.runtime
,vercel.host
, etc.instrumentations
: A set of instrumentations. By default,@vercel/otel
configures "fetch" instrumentation.instrumentationConfig
: Customize configuration for predefined instrumentations, such as "fetch".propagators
: A set of propagators that may extend inbound and outbound contexts. By default,@vercel/otel
configures W3C 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
andtraceExporter
: The export mechanism for traces. By default,@vercel/otel
configures the best export mechanism for the environment. For instance, if a tracing integrations is configured on Vercel, this integration will be automatically used for export; otherwise an OTLP exporter can be used if configured in environment variables.
See API for more details.
š License
Made with š by Vercel. Happy tracing! š
12 days ago
13 days ago
14 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago