@vtex/diagnostics-nodejs
Version:
Diagnostics library for Node.js applications
33 lines • 1.53 kB
TypeScript
import { Attributes, SpanKind, TimeInput } from '@opentelemetry/api';
import { Exporter } from '../types/exporters';
import { InstrumentationBase } from '@opentelemetry/instrumentation';
import { SpanProcessor } from '@opentelemetry/sdk-trace-base';
export type TracesOption = (config: TracesConfig) => void;
export declare class TracesConfig {
resourceAttributes: Attributes;
spanAttributes: Attributes;
instrumentations: InstrumentationBase[];
exporters: Exporter[];
processors: SpanProcessor[];
constructor(options?: TracesOption[]);
}
export declare function withResourceAttributes(attrs: Attributes): TracesOption;
export declare function withContribInstrumentation(instrumentation: InstrumentationBase): TracesOption;
export declare function withExporter(exporter: Exporter): TracesOption;
export declare function withSpanProcessor(processor: SpanProcessor): TracesOption;
export type SpanOption = (config: SpanConfig) => void;
export declare class SpanConfig {
attributes: Attributes;
kind?: SpanKind;
timestamp?: TimeInput;
constructor(options?: SpanOption[]);
}
export declare function withSpanAttributes(attrs: Attributes): SpanOption;
export declare function withSpanKind(kind: SpanKind): SpanOption;
export type SpanEndOption = (config: SpanEndConfig) => void;
export declare class SpanEndConfig {
timestamp?: TimeInput;
constructor(options?: SpanEndOption[]);
}
export declare function withEndTime(timestamp: TimeInput): SpanEndOption;
//# sourceMappingURL=config.d.ts.map