/**
 * Metrics Bridge for OpenTelemetry Traces
 *
 * Bridges trace data to Prometheus metrics for observability correlation.
 * Exports span duration histograms, error rates, and operation counts.
 *
 * @packageDocumentation
 */
import { Counter, Histogram, Gauge } from 'prom-client';
/**
 * Span duration histogram for all operations
 */
export declare const spanDurationHistogram: Histogram<"service" | "status" | "operation" | "span_kind">;
/**
 * Intent processing span duration
 */
export declare const intentSpanDuration: Histogram<"status" | "operation" | "intent_type">;
/**
 * Policy evaluation span duration
 */
export declare const policySpanDuration: Histogram<"namespace" | "action" | "status">;
/**
 * Security operation span duration
 */
export declare const securitySpanDuration: Histogram<"status" | "operation_type">;
/**
 * Database operation span duration
 */
export declare const dbSpanDuration: Histogram<"status" | "operation" | "table">;
/**
 * Cache operation span duration
 */
export declare const cacheSpanDuration: Histogram<"status" | "operation" | "hit">;
/**
 * HTTP request span duration
 */
export declare const httpSpanDuration: Histogram<"method" | "route" | "status_code">;
/**
 * Total span count by operation
 */
export declare const spanCounter: Counter<"service" | "status" | "operation" | "span_kind">;
/**
 * Span error counter
 */
export declare const spanErrorCounter: Counter<"service" | "operation" | "error_type">;
/**
 * Security event counter
 */
export declare const securityEventCounter: Counter<"tenant_id" | "event_type" | "risk_level">;
/**
 * Policy decision counter
 */
export declare const policyDecisionCounter: Counter<"namespace" | "action" | "result">;
/**
 * Trust evaluation counter
 */
export declare const trustEvalCounter: Counter<"result" | "trust_level">;
/**
 * Currently active spans
 */
export declare const activeSpansGauge: Gauge<"service" | "operation">;
/**
 * Active HTTP requests
 */
export declare const activeHttpRequests: Gauge<"method" | "route">;
/**
 * Span metric labels
 */
export interface SpanMetricLabels {
    service: string;
    operation: string;
    spanKind: string;
    status: 'ok' | 'error' | 'unset';
}
/**
 * Record span completion metrics
 *
 * @param labels - Span labels
 * @param durationMs - Span duration in milliseconds
 */
export declare function recordSpanMetrics(labels: SpanMetricLabels, durationMs: number): void;
/**
 * Record span error
 *
 * @param service - Service name
 * @param operation - Operation name
 * @param errorType - Error type/name
 */
export declare function recordSpanError(service: string, operation: string, errorType: string): void;
/**
 * Record intent span metrics
 *
 * @param operation - Operation name
 * @param intentType - Intent type
 * @param status - Span status
 * @param durationMs - Duration in milliseconds
 */
export declare function recordIntentSpanMetrics(operation: string, intentType: string, status: 'ok' | 'error', durationMs: number): void;
/**
 * Record policy span metrics
 *
 * @param namespace - Policy namespace
 * @param action - Policy action
 * @param status - Span status
 * @param durationMs - Duration in milliseconds
 */
export declare function recordPolicySpanMetrics(namespace: string, action: string, status: 'ok' | 'error', durationMs: number): void;
/**
 * Record security span metrics
 *
 * @param operationType - Security operation type
 * @param status - Span status
 * @param durationMs - Duration in milliseconds
 */
export declare function recordSecuritySpanMetrics(operationType: string, status: 'ok' | 'error', durationMs: number): void;
/**
 * Record database span metrics
 *
 * @param operation - DB operation (select, insert, update, delete)
 * @param table - Table name
 * @param status - Span status
 * @param durationMs - Duration in milliseconds
 */
export declare function recordDbSpanMetrics(operation: string, table: string, status: 'ok' | 'error', durationMs: number): void;
/**
 * Record cache span metrics
 *
 * @param operation - Cache operation (get, set, del)
 * @param hit - Whether cache hit (for get operations)
 * @param status - Span status
 * @param durationMs - Duration in milliseconds
 */
export declare function recordCacheSpanMetrics(operation: string, hit: boolean, status: 'ok' | 'error', durationMs: number): void;
/**
 * Record HTTP span metrics
 *
 * @param method - HTTP method
 * @param route - Route pattern
 * @param statusCode - HTTP status code
 * @param durationMs - Duration in milliseconds
 */
export declare function recordHttpSpanMetrics(method: string, route: string, statusCode: number, durationMs: number): void;
/**
 * Record security event
 *
 * @param eventType - Security event type
 * @param riskLevel - Risk level (low, medium, high, critical)
 * @param tenantId - Tenant ID (optional)
 */
export declare function recordSecurityEvent(eventType: string, riskLevel: 'low' | 'medium' | 'high' | 'critical', tenantId?: string): void;
/**
 * Record policy decision
 *
 * @param namespace - Policy namespace
 * @param action - Policy action
 * @param result - Decision result (allow, deny, escalate)
 */
export declare function recordPolicyDecision(namespace: string, action: string, result: 'allow' | 'deny' | 'escalate'): void;
/**
 * Record trust evaluation
 *
 * @param result - Evaluation result (passed, failed, insufficient)
 * @param trustLevel - Required trust level
 */
export declare function recordTrustEvaluation(result: 'passed' | 'failed' | 'insufficient', trustLevel: number): void;
/**
 * Increment active span count
 *
 * @param service - Service name
 * @param operation - Operation name
 */
export declare function incrementActiveSpans(service: string, operation: string): void;
/**
 * Decrement active span count
 *
 * @param service - Service name
 * @param operation - Operation name
 */
export declare function decrementActiveSpans(service: string, operation: string): void;
/**
 * Increment active HTTP requests
 *
 * @param method - HTTP method
 * @param route - Route pattern
 */
export declare function incrementActiveHttpRequests(method: string, route: string): void;
/**
 * Decrement active HTTP requests
 *
 * @param method - HTTP method
 * @param route - Route pattern
 */
export declare function decrementActiveHttpRequests(method: string, route: string): void;
/**
 * Span processor hook for metrics recording
 *
 * This function should be called when a span ends to record metrics.
 */
export interface SpanEndData {
    name: string;
    service: string;
    kind: 'internal' | 'server' | 'client' | 'producer' | 'consumer';
    status: 'ok' | 'error' | 'unset';
    durationMs: number;
    attributes: Record<string, string | number | boolean | undefined>;
    error?: Error;
}
/**
 * Process span end for metrics recording
 *
 * Call this from span processor or instrumentation hooks to
 * automatically record metrics for completed spans.
 *
 * @param data - Span end data
 */
export declare function processSpanForMetrics(data: SpanEndData): void;
/**
 * Initialize metrics bridge
 *
 * Sets up any required initialization for the metrics bridge.
 */
export declare function initializeMetricsBridge(): void;
/**
 * Get all trace-related metrics for debugging
 */
export declare function getTraceMetrics(): Record<string, number>;
//# sourceMappingURL=metrics-bridge.d.ts.map