Registers OTel Tracer and Meter instances in the DI container.
Tracer
Meter
Both are resolved lazily from the global providers configured by setupOtel, so this helper can be called at DI setup time even before the SDK has fully started.
setupOtel
the ServiceCollection to register with
ServiceCollection
Optional
tracer / meter naming overrides
import { configureOtel, ITracer } from '@cleverbrush/otel';configureOtel(services, { tracerName: 'todo-backend' });const tracer = provider.get(ITracer);tracer.startActiveSpan('custom-work', span => { // … span.end();}); Copy
import { configureOtel, ITracer } from '@cleverbrush/otel';configureOtel(services, { tracerName: 'todo-backend' });const tracer = provider.get(ITracer);tracer.startActiveSpan('custom-work', span => { // … span.end();});
Registers OTel
TracerandMeterinstances in the DI container.Both are resolved lazily from the global providers configured by
setupOtel, so this helper can be called at DI setup time even before the SDK has fully started.