import { Module, Global } from "@nestjs/common";
import { TelemetryService } from "./telemetry.service";
import { TelemetryInterceptor } from "./telemetry.interceptor";
import { SpanContextService } from "./span-context.service";

/**
 * Global module providing OpenTelemetry distributed tracing.
 * Automatically instruments HTTP requests and provides utilities for LLM tracing.
 *
 * @example
 * ```typescript
 * @Module({
 *   imports: [TelemetryModule],
 * })
 * export class AppModule {}
 * ```
 */
@Global()
@Module({
  providers: [TelemetryService, TelemetryInterceptor, SpanContextService],
  exports: [TelemetryService, TelemetryInterceptor, SpanContextService],
})
export class TelemetryModule {}
