@zidhuss/otel-bun-process-detector
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

OpenTelemetry Process Detector for Bun

A Bun-compatible version of the OpenTelemetry Process Detector for Node.

Motivation

The default process detector included in the SDK sets the following resources for nodejs[^1].

      [SEMRESATTRS_PROCESS_RUNTIME_VERSION]: process.versions.node,
      [SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'nodejs',
      [SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js',

This package provides accurate attributes for Bun processes:

      [ATTR_PROCESS_RUNTIME_VERSION]: process.versions.bun,
      [ATTR_PROCESS_RUNTIME_NAME]: "bun",
      [ATTR_PROCESS_RUNTIME_DESCRIPTION]: "Bun",

Installation

bun add @zidhuss/otel-bun-process-detector

Usage

Explicitly pass in all resource detectors that you want the SDK to use.

import { envDetector, hostDetector } from "@opentelemetry/resources"
import { NodeSDK } from "@opentelemetry/sdk-node"
import { processDetector } from "@zidhuss/otel-bun-process-detector"

const sdk = new NodeSDK({
	resourceDetectors: [envDetector, hostDetector, processDetector],
  // ...other configuration options
})

[^1: NodeJS Process Detector

Readme

Keywords

Package Sidebar

Install

npm i @zidhuss/otel-bun-process-detector

Weekly Downloads

0

Version

0.1.0

License

Apache-2.0

Unpacked Size

58.6 kB

Total Files

7

Last publish

Collaborators

  • zidhuss