import type { Span as ObserveSpan } from './types';
export declare class ObserveDashboardService {
    private logger;
    constructor();
    /**
     * The set of columns this service knows how to populate in `agg_daily`.
     * We dynamically intersect this list with the live ClickHouse schema to avoid
     * hard failures when columns are added/removed.
     */
    private static readonly AGG_DAILY_KNOWN_COLUMNS;
    /**
     * Same as AGG_DAILY_KNOWN_COLUMNS, but for `agg_hourly` (time key = `hour` DateTime).
     */
    private static readonly AGG_HOURLY_KNOWN_COLUMNS;
    private aggDailyColumnsCache;
    private aggHourlyColumnsCache;
    private getAggDailyColumns;
    private getAggHourlyColumns;
    private aggDailyDashboardColumnsCache;
    private getAggDailyDashboardColumns;
    getObserveDashboardConfig: (workspaceId: string, applicationId?: string, fetchVersions?: boolean) => Promise<{
        versions?: {
            version: string;
            firstSeen: string;
        }[] | undefined;
        id: string;
        name: string;
        workspaceId: string;
        description: string | null;
        status: number;
        widgets: any[];
        positions: any[];
    } | null>;
    private normalizeObserveSpan;
    normalizeObserveSpans(spans: any[]): ObserveSpan[];
    private chString;
    private histogramBucketMs;
    private extractTtftMs;
    private buildMapSumStateExpr;
    /**
     * Histogram aggregation that *merges correctly* in AggregatingMergeTree:
     * store as AggregateFunction(sumMap, Array(String), Array(UInt64)) via sumMapState(keys, values).
     *
     * This avoids the "only first row wins" behavior of Map(String, AggregateFunction(...)) during merges.
     */
    private buildHistogramSumMapStateExpr;
    private buildMetricsMapStateExpr;
    /** Build ClickHouse state expression for vectordb_responseTimeByOperation: map(opName -> (sumState, countState, quantilesState)). */
    private buildVectordbResponseTimeByOperationStateExpr;
    /** Build exprByCol entries for all vectordb_* columns. When vectordbName is empty, use default zero/empty states. */
    private buildVectordbExprByCol;
    private buildAggDailyRowSql;
    private buildAggDailyRowSelectSql;
    private buildAggHourlyRowSql;
    private buildAggHourlyRowSelectSql;
    private buildAggDailyDashboardRowSelectSql;
    private writeAggDailyFromSpans;
    populateObservationDashboardData: ({ applicationId, traceId, spans, monitoringConfig, workspaceId, application, }: {
        applicationId: string;
        traceId: string;
        spans: any[];
        monitoringConfig: any;
        workspaceId: string;
        application: any;
    }) => Promise<void>;
}
export declare const observeDashboardService: ObserveDashboardService;
//# sourceMappingURL=observeDashboard.d.ts.map