@jenova-marie/wonder-logger - v2.0.15
    Preparing search index...

    Function createTelemetry

    • Creates and initializes OpenTelemetry instrumentation

      Builds a fully configured NodeSDK instance with:

      • Service resource metadata
      • Trace exporter (console, OTLP, or Jaeger)
      • Metrics exporters (Prometheus and/or OTLP)
      • Auto-instrumentation for Node.js libraries
      • Graceful shutdown handlers

      Parameters

      Returns TelemetrySDK

      Initialized NodeSDK instance

      // Basic usage with console exporter
      const sdk = createTelemetry({
      serviceName: 'my-api',
      serviceVersion: '1.0.0'
      })

      // Production with OTLP exporters
      const sdk = createTelemetry({
      serviceName: 'my-api',
      serviceVersion: '1.0.0',
      environment: 'production',
      tracing: {
      exporter: 'otlp'
      },
      metrics: {
      exporters: ['prometheus', 'otlp'],
      port: 9090
      }
      })