UNPKG

nestjs-otel

Version:
15 lines (14 loc) 880 B
import { type SpanOptions } from "@opentelemetry/api"; export interface ExtendedSpanOptions extends SpanOptions { /** * Callback to run when the method returns successfully. * Allows setting attributes based on the return value. */ onResult?: (result: any) => { attributes?: SpanOptions["attributes"]; } | undefined; } type SpanDecoratorOptions<T extends any[]> = ExtendedSpanOptions | ((...args: T) => ExtendedSpanOptions); export declare function Span<T extends any[]>(options?: SpanDecoratorOptions<T>): (target: any, propertyKey: PropertyKey, propertyDescriptor: TypedPropertyDescriptor<(...args: T) => any>) => void; export declare function Span<T extends any[]>(name?: string, options?: SpanDecoratorOptions<T>): (target: any, propertyKey: PropertyKey, propertyDescriptor: TypedPropertyDescriptor<(...args: T) => any>) => void; export {};