1.8.2 ā€¢ Published 12 days ago

@vercel/otel v1.8.2

Weekly downloads
-
License
MIT
Repository
-
Last release
12 days ago

šŸš€ Vercel Otel

npm

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 as vercel.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 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 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

MIT


Made with šŸ’– by Vercel. Happy tracing! šŸ“ˆ

1.8.2

13 days ago

1.8.1

1 month ago

1.8.0

1 month ago

1.7.2

1 month ago

1.7.1

1 month ago

1.7.0

1 month ago

1.6.2

2 months ago

1.6.1

2 months ago

1.6.0

2 months ago

1.5.0

2 months ago

1.4.0

3 months ago

1.3.0

3 months ago

1.2.1

3 months ago

1.2.0

3 months ago

1.1.0

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.17

1 year ago

0.0.15

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago