Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timneutkens/otel
https://github.com/timneutkens/otel
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/timneutkens/otel
- Owner: timneutkens
- License: mit
- Created: 2023-04-06T12:34:26.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-06T12:34:53.000Z (almost 2 years ago)
- Last Synced: 2024-10-05T12:41:03.941Z (4 months ago)
- Size: 101 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🚀 Vercel Otel
[![npm](https://img.shields.io/npm/v/@vercel/otel.svg)](https://www.npmjs.com/package/@vercel/otel)
> **Note:** This package is experimental. Updates can contain breaking changes.
`vercel/otel` is a simple and easy-to-use package that sets up your trace provider and exporter.
💡 Use this package to quickly instrument your applications and get started with OpenTelemetry!
## 📦 Installation
```sh
npm install vercel/otel
```## 📚 Usage
```javascript
import { registerOTel } from "vercel/otel";
import { trace } from "@opentelemetry/api";// Register the OpenTelemetry provider with an HTTP exporter
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 provider with an HTTP exporter using the given service name.
This is all that is needed to trace your app on Vercel.- `serviceName`: The name of your service, used as the app name in many OpenTelemetry backends.
## 📄 License
[MIT](LICENSE)
---
Made with 💖 by Vercel. Happy tracing! 📈