solarwinds-apm
Version:
OpenTelemetry-based SolarWinds APM library
157 lines • 9.2 kB
TypeScript
import { type Instrumentation } from "@opentelemetry/instrumentation";
import { type ResourceDetector } from "@opentelemetry/resources";
import { type InstrumentationConfigMap, type ResourceDetectorConfigMap, type Set } from "@solarwinds-apm/instrumentations";
import * as v from "valibot";
interface Instrumentations {
configs?: InstrumentationConfigMap;
extra?: Instrumentation[];
set?: Set;
}
interface ResourceDetectors {
configs?: ResourceDetectorConfigMap;
extra?: ResourceDetector[];
set?: Set;
}
declare const schema: v.SchemaWithPipe<readonly [v.IntersectSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
readonly enabled: v.OptionalSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.SchemaWithPipe<readonly [v.PicklistSchema<["true", "false", "1", "0"], undefined>, v.TransformAction<"0" | "1" | "true" | "false", boolean>]>], undefined>, true>;
readonly serviceKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, {
token: string | undefined;
name: string;
}>]> | v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, {
token: string | undefined;
name: string;
}>]>, string>;
readonly collector: v.OptionalSchema<v.UnionSchema<[v.InstanceSchema<{
new (url: string | URL, base?: string | URL): URL;
prototype: URL;
canParse(url: string | URL, base?: string | URL): boolean;
createObjectURL(obj: Blob | MediaSource): string;
parse(url: string | URL, base?: string | URL): URL | null;
revokeObjectURL(url: string): void;
}, undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RawTransformAction<string, URL>]>], undefined>, "apm.collector.na-01.cloud.solarwinds.com">;
readonly logLevel: v.OptionalSchema<v.SchemaWithPipe<readonly [v.PicklistSchema<["all", "verbose", "debug", "info", "warn", "error", "none"], undefined>, v.TransformAction<"all" | "verbose" | "debug" | "info" | "warn" | "error" | "none", import("@opentelemetry/api").DiagLogLevel>]>, "warn">;
readonly tracingMode: v.OptionalSchema<v.SchemaWithPipe<readonly [v.PicklistSchema<["enabled", "disabled"], undefined>, v.TransformAction<"enabled" | "disabled", boolean>]>, undefined>;
readonly triggerTraceEnabled: v.OptionalSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.SchemaWithPipe<readonly [v.PicklistSchema<["true", "false", "1", "0"], undefined>, v.TransformAction<"0" | "1" | "true" | "false", boolean>]>], undefined>, boolean>;
readonly exportLogsEnabled: v.OptionalSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.SchemaWithPipe<readonly [v.PicklistSchema<["true", "false", "1", "0"], undefined>, v.TransformAction<"0" | "1" | "true" | "false", boolean>]>], undefined>, false>;
readonly transactionName: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, () => string>]>, v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.TransformAction<(...args: unknown[]) => unknown, () => string>]>], undefined>, undefined>;
readonly transactionSettings: v.OptionalSchema<v.ArraySchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
readonly tracing: v.SchemaWithPipe<readonly [v.PicklistSchema<["enabled", "disabled"], undefined>, v.TransformAction<"enabled" | "disabled", boolean>]>;
readonly regex: v.UnionSchema<[v.InstanceSchema<RegExpConstructor, undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RawTransformAction<string, RegExp>]>], undefined>;
}, undefined>, v.TransformAction<{
tracing: boolean;
regex: RegExp;
}, {
tracing: boolean;
matcher: (ident: string) => boolean;
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
readonly tracing: v.SchemaWithPipe<readonly [v.PicklistSchema<["enabled", "disabled"], undefined>, v.TransformAction<"enabled" | "disabled", boolean>]>;
readonly matcher: v.FunctionSchema<undefined>;
}, undefined>, v.TransformAction<{
tracing: boolean;
matcher: (...args: unknown[]) => unknown;
}, {
tracing: boolean;
matcher: (ident: string) => boolean;
}>]>], undefined>, undefined>, undefined>;
}, undefined>, v.TransformAction<{
enabled: boolean;
serviceKey: {
token: string | undefined;
name: string;
};
collector: URL;
logLevel: import("@opentelemetry/api").DiagLogLevel;
tracingMode?: boolean | undefined;
triggerTraceEnabled: boolean;
exportLogsEnabled: boolean;
transactionName?: (() => string) | (() => string) | undefined;
transactionSettings?: ({
tracing: boolean;
matcher: (ident: string) => boolean;
} | {
tracing: boolean;
matcher: (ident: string) => boolean;
})[] | undefined;
}, import("./shared/config.js").Configuration>]>, v.ObjectSchema<{
readonly legacy: v.OptionalSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.SchemaWithPipe<readonly [v.PicklistSchema<["true", "false", "1", "0"], undefined>, v.TransformAction<"0" | "1" | "true" | "false", boolean>]>], undefined>, undefined>;
readonly trustedpath: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RawTransformAction<string, string>]>, undefined>;
readonly proxy: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly runtimeMetrics: v.OptionalSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.SchemaWithPipe<readonly [v.PicklistSchema<["true", "false", "1", "0"], undefined>, v.TransformAction<"0" | "1" | "true" | "false", boolean>]>], undefined>, boolean>;
readonly insertTraceContextIntoLogs: v.OptionalSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.SchemaWithPipe<readonly [v.PicklistSchema<["true", "false", "1", "0"], undefined>, v.TransformAction<"0" | "1" | "true" | "false", boolean>]>], undefined>, false>;
readonly insertTraceContextIntoQueries: v.OptionalSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.SchemaWithPipe<readonly [v.PicklistSchema<["true", "false", "1", "0"], undefined>, v.TransformAction<"0" | "1" | "true" | "false", boolean>]>], undefined>, false>;
readonly instrumentations: v.OptionalSchema<v.ObjectSchema<{
readonly configs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
readonly extra: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, readonly []>;
readonly set: v.OptionalSchema<v.PicklistSchema<["none", "core", "all"], undefined>, "all" | "core">;
}, undefined>, {}>;
readonly resourceDetectors: v.OptionalSchema<v.ObjectSchema<{
readonly configs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.RecordSchema<v.StringSchema<undefined>, v.BooleanSchema<undefined>, undefined>, undefined>, {}>;
readonly extra: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, readonly []>;
readonly set: v.OptionalSchema<v.PicklistSchema<["none", "core", "all"], undefined>, "all" | "core">;
}, undefined>, {}>;
}, undefined>], undefined>, v.TransformAction<import("./shared/config.js").Configuration & {
legacy?: boolean | undefined;
trustedpath?: string | undefined;
proxy?: string | undefined;
runtimeMetrics: boolean;
insertTraceContextIntoLogs: boolean;
insertTraceContextIntoQueries: boolean;
instrumentations: {
configs: {
[x: string]: unknown;
};
extra: unknown[];
set: "all" | "none" | "core";
};
resourceDetectors: {
configs: {
[x: string]: {
[x: string]: boolean;
};
};
extra: unknown[];
set: "all" | "none" | "core";
};
}, {
enabled: boolean;
service: string;
token?: string;
collector: URL;
headers: Record<string, string>;
otlp: {
traces: string;
metrics: string;
logs: string;
};
logLevel: import("@opentelemetry/api").DiagLogLevel;
tracingMode?: boolean;
triggerTraceEnabled: boolean;
exportLogsEnabled: boolean;
transactionName?: () => string;
transactionSettings?: {
tracing: boolean;
matcher: (ident: string) => boolean;
}[];
legacy: boolean;
trustedpath?: string | undefined;
proxy?: string | undefined;
runtimeMetrics: boolean;
insertTraceContextIntoLogs: boolean;
insertTraceContextIntoQueries: boolean;
appoptics: boolean;
instrumentations: Required<Instrumentations>;
resourceDetectors: Required<ResourceDetectors>;
}>]>;
/** User provided configuration for solarwinds-apm */
export interface Config extends v.InferInput<typeof schema> {
instrumentations?: Instrumentations;
resourceDetectors?: ResourceDetectors;
}
/** Processed configuration for Node.js solarwinds-apm */
export interface Configuration extends v.InferOutput<typeof schema> {
source?: string;
}
export declare function read(): Promise<Configuration>;
export declare function printError(err: unknown): void;
export {};
//# sourceMappingURL=config.d.ts.map