Libraries
    Preparing search index...

    Function configureOtel

    • Registers OTel Tracer and Meter instances in the DI container.

      Both are resolved lazily from the global providers configured by import('./setupOtel.js').setupOtel, so this helper can be called at DI setup time even before the SDK has fully started.

      Parameters

      • services: any

        the ServiceCollection to register with

      • Optionaloptions: ConfigureOtelOptions

        tracer / meter naming overrides

      Returns void

      import { configureOtel, ITracer } from '@cleverbrush/otel';

      configureOtel(services, { tracerName: 'todo-backend' });

      const tracer = provider.get(ITracer);
      tracer.startActiveSpan('custom-work', span => {
      // …
      span.end();
      });