import { StorageDomain } from '../base.js'; import type { GetEntityTypesArgs, GetEntityTypesResponse, GetEntityNamesArgs, GetEntityNamesResponse, GetServiceNamesArgs, GetServiceNamesResponse, GetEnvironmentsArgs, GetEnvironmentsResponse, GetTagsArgs, GetTagsResponse, GetMetricNamesArgs, GetMetricNamesResponse, GetMetricLabelKeysArgs, GetMetricLabelKeysResponse, GetMetricLabelValuesArgs, GetMetricLabelValuesResponse } from './discovery.js'; import type { BatchCreateFeedbackArgs, CreateFeedbackArgs, ListFeedbackArgs, ListFeedbackResponse, GetFeedbackAggregateArgs, GetFeedbackAggregateResponse, GetFeedbackBreakdownArgs, GetFeedbackBreakdownResponse, GetFeedbackTimeSeriesArgs, GetFeedbackTimeSeriesResponse, GetFeedbackPercentilesArgs, GetFeedbackPercentilesResponse } from './feedback.js'; import type { BatchCreateLogsArgs, ListLogsArgs, ListLogsResponse } from './logs.js'; import type { BatchCreateMetricsArgs, ListMetricsArgs, ListMetricsResponse, GetMetricAggregateArgs, GetMetricAggregateResponse, GetMetricBreakdownArgs, GetMetricBreakdownResponse, GetMetricTimeSeriesArgs, GetMetricTimeSeriesResponse, GetMetricPercentilesArgs, GetMetricPercentilesResponse } from './metrics.js'; import type { BatchCreateScoresArgs, CreateScoreArgs, ListScoresArgs, ListScoresResponse, ScoreRecord, GetScoreAggregateArgs, GetScoreAggregateResponse, GetScoreBreakdownArgs, GetScoreBreakdownResponse, GetScoreTimeSeriesArgs, GetScoreTimeSeriesResponse, GetScorePercentilesArgs, GetScorePercentilesResponse } from './scores.js'; import type { BatchCreateSpansArgs, BatchDeleteTracesArgs, BatchUpdateSpansArgs, CreateSpanArgs, GetBranchArgs, GetBranchResponse, GetRootSpanArgs, GetRootSpanResponse, GetSpanArgs, GetSpanResponse, GetSpansArgs, GetSpansResponse, GetStructureResponse, GetTraceArgs, GetTraceResponse, GetTraceLightResponse, ListBranchesArgs, ListBranchesResponse, ListTracesArgs, ListTracesLightResponse, ListTracesResponse, UpdateSpanArgs } from './tracing.js'; import type { ObservabilityStorageStrategy, TracingStorageStrategy } from './types.js'; export type ObservabilityStorageFeature = 'delta-polling'; /** * Base storage class for observability data (traces, metrics, logs, scores, feedback). * Not abstract -- provides default implementations that throw "not implemented" errors. * Storage adapters override only the methods they support. */ export declare class ObservabilityStorage extends StorageDomain { constructor(); dangerouslyClearAll(): Promise; /** * Provides hints for tracing strategy selection by the MastraStorageExporter. * Storage adapters can override this to specify their preferred and supported strategies. */ get observabilityStrategy(): { preferred: ObservabilityStorageStrategy; supported: ObservabilityStorageStrategy[]; }; /** * Provides hints for tracing strategy selection by the MastraStorageExporter. * Storage adapters can override this to specify their preferred and supported strategies. * @deprecated Use {@link observabilityStrategy} instead. * @see {@link observabilityStrategy} for the replacement property. */ get tracingStrategy(): { preferred: TracingStorageStrategy; supported: TracingStorageStrategy[]; }; /** * Reports the tracing strategy currently in effect for this attached observability store. * * Single-strategy stores can rely on the default implementation. Multi-strategy stores * should override this getter only when they can determine the actual configured mode * from storage-owned configuration, not exporter state. */ get runtimeTracingStrategy(): TracingStorageStrategy | undefined; /** * Optional feature list for observability storage APIs. * Stores that implement delta polling should override this and opt in explicitly. * Older stores and older package versions will simply omit it, which keeps page mode working. */ getFeatures(): readonly ObservabilityStorageFeature[] | undefined; /** * Creates a single Span record in the storage provider. */ createSpan(_args: CreateSpanArgs): Promise; /** * Updates a single Span with partial data. Primarily used for realtime trace creation. * * @deprecated This method only works with stores that support span updates, * It will be removed in the future. Instead try to add all data to a span before * ending it. */ updateSpan(_args: UpdateSpanArgs): Promise; /** * Retrieves a single span. */ getSpan(_args: GetSpanArgs): Promise; /** * Retrieves a single root span. */ getRootSpan(_args: GetRootSpanArgs): Promise; /** * Retrieves a single trace with all its associated spans. */ getTrace(_args: GetTraceArgs): Promise; /** * Retrieves the structural skeleton of a trace -- parent/child links, span * type, timing, and status -- with heavy fields (input, output, attributes, * metadata, tags, links) excluded. Intended for waterfall/timeline rendering * where the full payload would be wasteful. * * Default implementation forwards to {@link getTraceLight} (the legacy * override surface). Backends should override either method -- the response * shape is identical, and the unimplemented one delegates to the * implemented one. The cycle guard is what makes that safe. */ getStructure(args: GetTraceArgs): Promise; /** * @deprecated Use {@link getStructure} instead. Default implementation * forwards to {@link getStructure} so backends that only override the * canonical name still work for legacy callers. */ getTraceLight(args: GetTraceArgs): Promise; /** * Retrieves the subtree of spans rooted at a given span, optionally bounded * to `depth` levels of descendants. * * Default implementation prefers a two-step path: fetch the lightweight * structure to determine which spans belong to the branch, then batch-fetch * only those with full data. This avoids pulling the entire trace when the * branch is a small slice of a large trace. Backends that don't yet * implement {@link getStructure} or {@link getSpans} fall back to fetching * the full trace and walking it in memory. */ getBranch(args: GetBranchArgs): Promise; /** * Batch-fetches spans by spanId within a single trace. Used by the * optimized {@link getBranch} path to fetch only the spans that belong to * the requested branch (after walking the lightweight structure to identify * them) instead of pulling the entire trace. */ getSpans(_args: GetSpansArgs): Promise; /** * Retrieves a list of traces with optional filtering. */ listTraces(_args: ListTracesArgs): Promise; /** * Retrieves a lightweight list of traces with optional filtering. */ listTracesLight(_args: ListTracesArgs): Promise; /** * Lists trace branches across all traces. Unlike {@link listTraces} (which * returns one row per root-rooted trace), each row here is a single branch * anchor span, including ones nested under a different root entity -- useful * for "show me every run of agent X" regardless of caller. Pairs with * {@link getBranch} to expand a single branch into its subtree. */ listBranches(_args: ListBranchesArgs): Promise; /** * Creates multiple Spans in a single batch. */ batchCreateSpans(_args: BatchCreateSpansArgs): Promise; /** * Updates multiple Spans in a single batch. */ batchUpdateSpans(_args: BatchUpdateSpansArgs): Promise; /** * Deletes multiple traces and all their associated spans in a single batch operation. */ batchDeleteTraces(_args: BatchDeleteTracesArgs): Promise; /** * Creates multiple log records in a single batch. */ batchCreateLogs(_args: BatchCreateLogsArgs): Promise; /** * Retrieves a list of logs with optional filtering. */ listLogs(_args: ListLogsArgs): Promise; /** * Creates multiple metric observations in a single batch. */ batchCreateMetrics(_args: BatchCreateMetricsArgs): Promise; listMetrics(_args: ListMetricsArgs): Promise; getMetricAggregate(_args: GetMetricAggregateArgs): Promise; getMetricBreakdown(_args: GetMetricBreakdownArgs): Promise; getMetricTimeSeries(_args: GetMetricTimeSeriesArgs): Promise; getMetricPercentiles(_args: GetMetricPercentilesArgs): Promise; getMetricNames(_args: GetMetricNamesArgs): Promise; getMetricLabelKeys(_args: GetMetricLabelKeysArgs): Promise; getMetricLabelValues(_args: GetMetricLabelValuesArgs): Promise; getEntityTypes(_args: GetEntityTypesArgs): Promise; getEntityNames(_args: GetEntityNamesArgs): Promise; getServiceNames(_args: GetServiceNamesArgs): Promise; getEnvironments(_args: GetEnvironmentsArgs): Promise; getTags(_args: GetTagsArgs): Promise; /** * Creates a single score record. */ createScore(_args: CreateScoreArgs): Promise; /** * Creates multiple score observations in a single batch. */ batchCreateScores(_args: BatchCreateScoresArgs): Promise; /** * Retrieves a list of scores with optional filtering. */ listScores(_args: ListScoresArgs): Promise; /** * Retrieves a single score by its score ID. */ getScoreById(_scoreId: string): Promise; getScoreAggregate(_args: GetScoreAggregateArgs): Promise; getScoreBreakdown(_args: GetScoreBreakdownArgs): Promise; getScoreTimeSeries(_args: GetScoreTimeSeriesArgs): Promise; getScorePercentiles(_args: GetScorePercentilesArgs): Promise; /** * Creates a single feedback record. */ createFeedback(_args: CreateFeedbackArgs): Promise; /** * Creates multiple feedback observations in a single batch. */ batchCreateFeedback(_args: BatchCreateFeedbackArgs): Promise; /** * Retrieves a list of feedback with optional filtering. */ listFeedback(_args: ListFeedbackArgs): Promise; getFeedbackAggregate(_args: GetFeedbackAggregateArgs): Promise; getFeedbackBreakdown(_args: GetFeedbackBreakdownArgs): Promise; getFeedbackTimeSeries(_args: GetFeedbackTimeSeriesArgs): Promise; getFeedbackPercentiles(_args: GetFeedbackPercentilesArgs): Promise; } //# sourceMappingURL=base.d.ts.map