From e7aa96e1ceb34249055c1f64a0fd1b3f52b667b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Thu, 31 Aug 2023 13:22:16 -0700 Subject: [PATCH] use instrumentationbase for better validation --- packages/solarwinds-apm/src/config.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/solarwinds-apm/src/config.ts b/packages/solarwinds-apm/src/config.ts index a182d10c..c1f9f446 100644 --- a/packages/solarwinds-apm/src/config.ts +++ b/packages/solarwinds-apm/src/config.ts @@ -20,7 +20,7 @@ import * as process from "node:process" import { DiagLogLevel } from "@opentelemetry/api" import { type InstrumentationConfigMap } from "@opentelemetry/auto-instrumentations-node" -import { type Instrumentation } from "@opentelemetry/instrumentation" +import { InstrumentationBase } from "@opentelemetry/instrumentation" import { View } from "@opentelemetry/sdk-metrics" import { oboe } from "@solarwinds-apm/bindings" import { type SwConfiguration } from "@solarwinds-apm/sdk" @@ -131,7 +131,7 @@ const transactionSettings = z.array( interface Instrumentations { configs?: InstrumentationConfigMap - extra?: Instrumentation[] + extra?: InstrumentationBase[] } interface Metrics { @@ -154,7 +154,7 @@ const schema = z.object({ instrumentations: z .object({ configs: z.record(z.unknown()).optional(), - extra: z.array(z.unknown()).optional(), + extra: z.array(z.instanceof(InstrumentationBase)).optional(), }) .transform((i) => i as Instrumentations) .optional(),