/** * Common types */ export interface TraceAttribute { key: string; value: TraceAttributeValue; } export type TraceAttributeValue = { stringValue: string; } | { intValue: string; } | { boolValue: boolean; } | { arrayValue: { values: TraceAttributeValue[]; }; }; /** * An entire trace */ export interface Trace { rootSpan: Span; } export interface TraceResource { serviceName: string; attributes: TraceAttribute[]; } export interface TraceScope { name: string; } export interface Span { resource: TraceResource; scope: TraceScope; parentSpan?: Span; /** child spans, sorted by startTime */ childSpans: Span[]; traceId: string; spanId: string; parentSpanId?: string; name: string; kind: string; startTimeUnixMs: number; endTimeUnixMs: number; attributes: TraceAttribute[]; events: SpanEvent[]; status?: SpanStatus; } export interface SpanEvent { timeUnixMs: number; name: string; attributes: TraceAttribute[]; } export interface SpanStatus { code?: typeof SpanStatusUnset | typeof SpanStatusOk | typeof SpanStatusError; message?: string; } export declare const SpanStatusUnset = "STATUS_CODE_UNSET"; export declare const SpanStatusOk = "STATUS_CODE_OK"; export declare const SpanStatusError = "STATUS_CODE_ERROR"; /** * Partial trace information returned by search endpoint */ export interface TraceSearchResult { traceId: string; rootServiceName: string; rootTraceName: string; startTimeUnixMs: number; durationMs: number; serviceStats: Record; } export interface ServiceStats { spanCount: number; /** number of spans with errors, unset if zero */ errorCount?: number; } /** * A generalized data-model that will be used by Panel components * to display traces. * * If the query contains a valid trace ID, the 'trace' attribute will contain the entire trace. * If the query contains a TraceQL query, the 'searchResult' attribute will contain the search results. */ export interface TraceData { trace?: Trace; searchResult?: TraceSearchResult[]; metadata?: TraceMetaData; } export interface TraceMetaData { executedQueryString?: string; } export declare function isValidTraceId(traceId: string): boolean; //# sourceMappingURL=trace-data.d.ts.map