export type TelemetryAttributeScalar = boolean | number | string; export type TelemetryAttributeValue = TelemetryAttributeScalar | TelemetryAttributeScalar[]; export type TelemetryAttributes = Record; export type StoredSpanEvent = { attributes: TelemetryAttributes; name: string; timeUnixNano: string; }; export type StoredSpanLink = { attributes: TelemetryAttributes; spanId: string; traceId: string; traceState?: string; }; export type StoredSpan = { attributes: TelemetryAttributes; durationNano: string; endedAtUnixNano: string; events: StoredSpanEvent[]; kind: number; links: StoredSpanLink[]; name: string; parentSpanId?: string; resourceAttributes: TelemetryAttributes; scopeName: string; scopeVersion?: string; serviceName: string; spanId: string; startedAtUnixNano: string; statusCode: number; statusMessage?: string; traceFlags: number; traceId: string; traceState?: string; }; export type TraceSummary = { durationNano: string; endedAtUnixNano: string; errorSpanCount: number; rootName: string; serviceNames: string[]; spanCount: number; startedAtUnixNano: string; traceId: string; }; export type TraceStoreStats = { errorSpanCount: number; newestStartedAtUnixNano?: string; oldestStartedAtUnixNano?: string; serviceCount: number; spanCount: number; traceCount: number; }; export type TraceSeriesPoint = { bucketStartedAtUnixNano: string; errorSpanCount: number; p50DurationNano: string; p95DurationNano: string; spanCount: number; traceCount: number; }; export type TraceServiceSummary = { errorSpanCount: number; p95DurationNano: string; serviceName: string; spanCount: number; traceCount: number; }; export type TraceServiceEdge = { errorSpanCount: number; sourceServiceName: string; spanCount: number; targetServiceName: string; traceCount: number; }; export type TraceFilter = { cursorStartedAtUnixNano?: string; errorOnly?: boolean; limit?: number; maximumDurationNano?: string; minimumDurationNano?: string; name?: string; serviceName?: string; sinceUnixNano?: string; statusCode?: number; untilUnixNano?: string; }; export type TraceAnalyticsFilter = Pick; export type TraceSeriesFilter = TraceAnalyticsFilter & { bucketSeconds?: number; }; export type TraceStore = { getTrace: (traceId: string) => Promise; listTraces: (filter?: TraceFilter) => Promise; prune: (beforeUnixNano: string) => Promise; write: (spans: readonly StoredSpan[]) => Promise; }; export type TraceAnalyticsStore = TraceStore & { getServiceMap: (filter?: TraceAnalyticsFilter) => Promise; getStats: (filter?: TraceAnalyticsFilter) => Promise; getTraceSeries: (filter?: TraceSeriesFilter) => Promise; listServices: (filter?: TraceAnalyticsFilter) => Promise; }; type HrTime = readonly [number, number]; type SpanContextLike = { spanId: string; traceFlags: number; traceId: string; traceState?: { serialize: () => string; }; }; type SpanEventLike = { attributes?: Record; name: string; time: HrTime; }; type SpanLinkLike = { attributes?: Record; context: SpanContextLike; }; export type ReadableSpanLike = { attributes: Record; duration: HrTime; endTime: HrTime; events: SpanEventLike[]; instrumentationScope?: { name: string; version?: string; }; kind: number; links: SpanLinkLike[]; name: string; parentSpanContext?: SpanContextLike; resource: { attributes: Record; }; spanContext: () => SpanContextLike; startTime: HrTime; status: { code: number; message?: string; }; }; export type SpanExportResult = { code: 0 | 1; error?: Error; }; export type TraceStoreSpanExporter = { export: (spans: ReadableSpanLike[], callback: (result: SpanExportResult) => void) => void; forceFlush: () => Promise; shutdown: () => Promise; }; export type StoredSpanProjectionOptions = { attributeFilter?: (key: string) => boolean; redact?: (value: string) => string; serviceName?: string; }; export declare const projectStoredSpan: (span: ReadableSpanLike, options?: StoredSpanProjectionOptions) => StoredSpan; export declare const createTraceStoreSpanExporter: (options: { onError?: (error: unknown, batchSize: number) => void; projection?: StoredSpanProjectionOptions; store: TraceStore; }) => TraceStoreSpanExporter; export declare const createFanoutSpanExporter: (options: { exporters: readonly TraceStoreSpanExporter[]; onError?: (error: AggregateError, operation: "export" | "flush" | "shutdown") => void; }) => TraceStoreSpanExporter; export declare const createMemoryTraceStore: (options?: { maxSpans?: number; }) => TraceAnalyticsStore; export {}; //# sourceMappingURL=store.d.ts.map