Skip to content

Commit

Permalink
use instrumentationbase for better validation
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael-theriault-swi committed Aug 31, 2023
1 parent cea568c commit e7aa96e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/solarwinds-apm/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -131,7 +131,7 @@ const transactionSettings = z.array(

interface Instrumentations {
configs?: InstrumentationConfigMap
extra?: Instrumentation[]
extra?: InstrumentationBase[]
}

interface Metrics {
Expand All @@ -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(),
Expand Down

0 comments on commit e7aa96e

Please sign in to comment.