|
| 1 | +import { |
| 2 | + GrpcInstrumentation, |
| 3 | + type GrpcInstrumentationConfig, |
| 4 | +} from '@opentelemetry/instrumentation-grpc'; |
| 5 | +import { |
| 6 | + HttpInstrumentation, |
| 7 | + type HttpInstrumentationConfig, |
| 8 | +} from '@opentelemetry/instrumentation-http'; |
| 9 | +import { |
| 10 | + PinoInstrumentation, |
| 11 | + type PinoInstrumentationConfig, |
| 12 | +} from '@opentelemetry/instrumentation-pino'; |
| 13 | +import { |
| 14 | + UndiciInstrumentation, |
| 15 | + type UndiciInstrumentationConfig, |
| 16 | +} from '@opentelemetry/instrumentation-undici'; |
| 17 | + |
| 18 | +export function otelRegisterInstrumentations({ |
| 19 | + grpcInstrumentationConfig, |
| 20 | + httpInstrumentationConfig, |
| 21 | + undiciInstrumentationConfig, |
| 22 | + pinoInstrumentationConfig, |
| 23 | +}: { |
| 24 | + grpcInstrumentationConfig?: GrpcInstrumentationConfig; |
| 25 | + httpInstrumentationConfig?: HttpInstrumentationConfig; |
| 26 | + undiciInstrumentationConfig?: UndiciInstrumentationConfig; |
| 27 | + pinoInstrumentationConfig?: PinoInstrumentationConfig; |
| 28 | +} = {}) { |
| 29 | + return [ |
| 30 | + new GrpcInstrumentation(grpcInstrumentationConfig), |
| 31 | + new HttpInstrumentation(httpInstrumentationConfig), |
| 32 | + new UndiciInstrumentation(undiciInstrumentationConfig), |
| 33 | + new PinoInstrumentation(pinoInstrumentationConfig), |
| 34 | + ]; |
| 35 | +} |
0 commit comments