Skip to content

Commit 0a440dd

Browse files
authored
feat(opentelemetry): use rest args for addOpenTelemetryInstrumentation (#11721)
update the `addOpenTelemetryInstrumentation` API to use rest args.
1 parent bee0677 commit 0a440dd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/opentelemetry/src/instrumentation.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ import { registerInstrumentations } from '@opentelemetry/instrumentation';
55
* This method takes an OpenTelemetry instrumentation or
66
* array of instrumentations and registers them with OpenTelemetry.
77
*/
8-
export function addOpenTelemetryInstrumentation(
9-
instrumentation: InstrumentationOption | InstrumentationOption[],
10-
): void {
8+
export function addOpenTelemetryInstrumentation(...instrumentations: InstrumentationOption[]): void {
119
registerInstrumentations({
12-
instrumentations: Array.isArray(instrumentation) ? instrumentation : [instrumentation],
10+
instrumentations,
1311
});
1412
}

0 commit comments

Comments
 (0)