nitro-opentelemetry
v0.1.1
Published
<!-- automd:badges color=yellow -->
Downloads
63
Readme
nitro-opentelemetry
Opentelemetry integration for nitro. Without patching nitro.
This nitro module automatically create spans for request and error happening in your nitro server.
Usage
Install package:
# ✨ Auto-detect
npx nypm install nitro-opentelemetry
# npm
npm install nitro-opentelemetry
# yarn
yarn add nitro-opentelemetry
# pnpm
pnpm install nitro-opentelemetry
# bun
bun install nitro-opentelemetry
Add the module:
//https://nitro.unjs.io/config
export default defineNitroConfig({
modules: [
'nitro-opentelemetry'
]
});
Config
You can configure the module with the openTelemetry
property in your nitro.config.ts
- configFile
- This module provides some presets by default: node and azure. You can set your own file to configure and setup OTEL. Your file will be imported first before anything.
Hooks
Here are the available hooks.
interface NitroRuntimeHooks {
'otel:span:name': (context: { event: H3Event, name: undefined|string }) => void
}
- otel:span:name
- Ran when a span is created.
Development
- Clone this repository
- Install latest LTS version of Node.js
- Enable Corepack using
corepack enable
- Install dependencies using
pnpm install
- Run interactive tests using
pnpm dev
License
Published under the MIT license. Made by community 💛
🤖 auto updated with automd