import { Context } from '@dxos/context'; import { type MaybePromise } from '@dxos/util'; /** localStorage key that switches the browser OTEL sampler from 30% to 100%. */ export declare const TRACE_ALL_KEY = "dxos.debug.traceAll"; export type ResourceOptions = { annotation?: symbol; /** * Start a lifecycle span on `open()` and end it on `close()`. * `this._ctx` carries the lifecycle span's trace context, so background work * (subscriptions, timers) becomes children of the lifecycle span. * Direct calls within `_open` use the `_open` span's context as usual. * Requires the class to extend {@link Resource}. */ lifecycle?: boolean; }; export interface TimeAware { tick(timeMs: number): void; } export type InfoOptions = { /** * Value is of enum type and should be converted to string. * * Example: * * ```ts * @trace.info({ enum: SpaceState }) * get state(): SpaceState { ... } * ``` */ enum?: Record; /** * Max depth of the object to be included in the resource info section. * * null means no limit (a limit of 8 nested objects is still imposed). * * Default: 0 - objects will be stringified with toString. */ depth?: number | null; /** When true, the property value is also set as an OTEL span attribute on every span created by this resource. */ spanAttribute?: boolean; }; export type SpanOptions = { showInBrowserTimeline?: boolean; /** When false the span is not exported to remote OTLP collectors. Defaults to true. */ showInRemoteTracing?: boolean; op?: string; attributes?: Record; }; export type ManualSpanParams = { id: string; instance: any; methodName: string; parentCtx: Context | null; showInBrowserTimeline?: boolean; showInRemoteTracing?: boolean; op?: string; attributes?: Record; }; export type AddLinkOptions = {}; export type TraceDiagnosticProps = { /** Unique ID. */ id: string; /** * Human-readable name. * @defaults Defaults to `id` */ name?: string; /** Function that will be called to fetch the diagnostic data. */ fetch: () => MaybePromise; }; export interface TraceDiagnostic { id: string; unregister(): void; } export declare const trace: { addLink: (parent: any, child: any, opts?: AddLinkOptions) => void; diagnostic: (params: TraceDiagnosticProps) => TraceDiagnostic; info: (opts?: InfoOptions) => (target: any, propertyKey: string, descriptor?: PropertyDescriptor) => void; mark: (name: string) => void; metricsCounter: () => (target: any, propertyKey: string, descriptor?: PropertyDescriptor) => void; resource: (options?: ResourceOptions) => (constructor: T) => { new (...rest: any[]): {}; } & T; span: ({ showInBrowserTimeline, showInRemoteTracing, op, attributes }?: SpanOptions) => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<(...args: any) => any>) => void; spanStart: (params: ManualSpanParams) => Context | null; spanEnd: (id: string) => void; metrics: import(".").RemoteMetrics; }; //# sourceMappingURL=api.d.ts.map