/**
 * INTENT Metrics - Prometheus-compatible observability
 *
 * Provides comprehensive metrics for monitoring intent processing,
 * queue health, trust gate decisions, and system performance.
 *
 * Note: This module now uses the shared vorionRegistry from common/metrics-registry.ts
 * to avoid circular dependencies. The intentRegistry export is maintained for backwards
 * compatibility but points to the shared registry.
 */
import { Counter, Histogram, Gauge } from "prom-client";
import { queryTimeouts, tokensRevokedTotal, tokenRevocationChecks, recordQueryTimeout } from "../common/metrics-registry.js";
import type { IntentStatus } from "../common/types.js";
export declare const intentRegistry: import("prom-client").Registry<"text/plain; version=0.0.4; charset=utf-8">;
export { queryTimeouts, tokensRevokedTotal, tokenRevocationChecks, recordQueryTimeout, };
/**
 * Total intents submitted, labeled by tenant, intent type, and outcome
 */
export declare const intentsSubmittedTotal: Counter<"tenant_id" | "intent_type" | "outcome">;
/**
 * Intent status transitions
 */
export declare const intentStatusTransitions: Counter<"tenant_id" | "from_status" | "to_status">;
/**
 * Current intents by status (gauge)
 */
export declare const intentsCurrentByStatus: Gauge<"status" | "tenant_id">;
/**
 * Intent processing duration (from submission to terminal state)
 *
 * Re-exported from common/metrics to avoid duplicate Prometheus registration.
 * The canonical metric is defined in common/metrics.ts as intentProcessingDurationSeconds.
 */
export { intentProcessingDurationSeconds as intentProcessingDuration } from "../common/metrics.js";
/**
 * Trust gate evaluations
 */
export declare const trustGateEvaluations: Counter<"result" | "tenant_id" | "intent_type">;
/**
 * Trust level distribution at submission
 */
export declare const trustLevelAtSubmission: Histogram<"tenant_id" | "intent_type">;
/**
 * Queue depth (waiting jobs)
 */
export declare const queueDepth: Gauge<"queue_name">;
/**
 * Queue active jobs
 */
export declare const queueActiveJobs: Gauge<"queue_name">;
/**
 * Jobs processed total
 */
export declare const jobsProcessedTotal: Counter<"result" | "queue_name">;
/**
 * Job processing duration
 */
export declare const jobProcessingDuration: Histogram<"queue_name">;
/**
 * Dead letter queue size
 */
export declare const dlqSize: Gauge<string>;
/**
 * Escalations created
 */
export declare const escalationsCreated: Counter<"tenant_id" | "intent_type" | "reason_category">;
/**
 * Escalation resolutions
 */
export declare const escalationResolutions: Counter<"tenant_id" | "resolution">;
/**
 * Escalation pending duration
 */
export declare const escalationPendingDuration: Histogram<"tenant_id" | "resolution">;
/**
 * Current pending escalations
 */
export declare const escalationsPending: Gauge<"tenant_id">;
/**
 * Encryption operations
 */
export declare const encryptionOperations: Counter<"operation">;
/**
 * Encryption duration
 */
export declare const encryptionDuration: Histogram<"operation">;
/**
 * Policy evaluations total
 *
 * Re-exported from common/metrics to avoid duplicate Prometheus registration.
 */
import { policyEvaluationsTotal, policyEvaluationDurationSeconds as policyEvaluationDuration } from "../common/metrics.js";
export { policyEvaluationsTotal };
/**
 * Policy evaluation duration
 *
 * Re-exported from common/metrics to avoid duplicate Prometheus registration.
 */
export { policyEvaluationDuration };
/**
 * Policies matched per evaluation
 */
export declare const policiesMatchedPerEvaluation: Histogram<"namespace" | "tenant_id">;
/**
 * Policy overrides (policy action differed from rule action)
 */
export declare const policyOverridesTotal: Counter<"tenant_id" | "rule_action" | "policy_action">;
/**
 * Policies loaded from cache vs database
 */
export declare const policyLoadSource: Counter<"source">;
/**
 * Database query duration (histogram)
 */
export declare const dbQueryDuration: Histogram<"operation">;
/**
 * Total database queries by operation type
 */
export declare const dbQueryTotal: Counter<"operation">;
/**
 * Total failed database queries
 */
export declare const dbQueryErrorsTotal: Counter<"operation" | "error_type">;
/**
 * Current active database connections
 */
export declare const dbPoolConnectionsActive: Gauge<string>;
/**
 * Current idle database connections
 */
export declare const dbPoolConnectionsIdle: Gauge<string>;
/**
 * Clients waiting for a connection
 */
export declare const dbPoolConnectionsWaiting: Gauge<string>;
/**
 * Lock contention events during deduplication
 */
export declare const deduplicateLockContentionTotal: Counter<"tenant_id" | "outcome">;
/**
 * Trust gate bypass events (when bypassTrustGate is used)
 */
export declare const trustGateBypassesTotal: Counter<"tenant_id" | "intent_type">;
/**
 * Intent deduplication attempts
 */
export declare const intentDeduplicationsTotal: Counter<"tenant_id" | "outcome">;
/**
 * Policy cache hits
 */
export declare const policyCacheHitsTotal: Counter<"namespace" | "tenant_id">;
/**
 * Policy cache misses
 */
export declare const policyCacheMissesTotal: Counter<"namespace" | "tenant_id">;
/**
 * Escalation SLA breach rate gauge (0-1 representing percentage)
 */
export declare const escalationSlaBreachRateGauge: Gauge<"tenant_id">;
/**
 * Intent context size in bytes (histogram)
 */
export declare const intentContextSizeBytes: Histogram<"tenant_id" | "intent_type">;
/**
 * Webhook delivery success counter
 */
export declare const webhookDeliverySuccessTotal: Counter<"tenant_id" | "event_type">;
/**
 * Webhook delivery failure counter
 */
export declare const webhookDeliveryFailureTotal: Counter<"tenant_id" | "event_type">;
/**
 * Current circuit breaker state per webhook (0=closed, 1=open, 2=half_open)
 */
export declare const webhookCircuitBreakerState: Gauge<"tenant_id" | "webhook_id">;
/**
 * Total number of circuit breaker trips (circuit opening)
 */
export declare const webhookCircuitBreakerTripsTotal: Counter<"tenant_id" | "webhook_id">;
/**
 * Webhook deliveries skipped due to open circuit
 */
export declare const webhookDeliveriesSkippedTotal: Counter<"tenant_id" | "webhook_id">;
/**
 * Circuit breaker state transitions
 */
export declare const webhookCircuitBreakerTransitions: Counter<"tenant_id" | "webhook_id" | "from_state" | "to_state">;
/**
 * Escalation approval rate gauge (0-1 representing percentage of approvals)
 */
export declare const escalationApprovalRateGauge: Gauge<"tenant_id">;
/**
 * Circuit breaker state changes (generic, for any circuit breaker)
 */
export declare const circuitBreakerStateChanges: Counter<"name" | "from_state" | "to_state">;
/**
 * Current circuit breaker state (gauge: 0=CLOSED, 1=HALF_OPEN, 2=OPEN)
 */
export declare const circuitBreakerState: Gauge<"name">;
/**
 * Circuit breaker executions
 */
export declare const circuitBreakerExecutions: Counter<"name" | "result">;
/**
 * Circuit breaker failure count (gauge for current failure count)
 */
export declare const circuitBreakerFailures: Gauge<"name">;
/**
 * Per-service circuit breaker state gauge (0=CLOSED, 1=HALF_OPEN, 2=OPEN)
 * Uses 'service' label for service-specific identification
 */
export declare const serviceCircuitBreakerState: Gauge<"service">;
/**
 * Per-service circuit breaker failures total
 */
export declare const serviceCircuitBreakerFailuresTotal: Counter<"service">;
/**
 * Per-service circuit breaker successes total
 */
export declare const serviceCircuitBreakerSuccessesTotal: Counter<"service">;
/**
 * Per-service circuit breaker trips (circuit opening)
 */
export declare const serviceCircuitBreakerTripsTotal: Counter<"service">;
/**
 * Per-service circuit breaker recovery (circuit closing after half-open)
 */
export declare const serviceCircuitBreakerRecoveriesTotal: Counter<"service">;
/**
 * Per-service circuit breaker half-open attempts
 */
export declare const serviceCircuitBreakerHalfOpenAttempts: Gauge<"service">;
/**
 * Errors by type
 */
export declare const errorsTotal: Counter<"component" | "error_code">;
/**
 * Cleanup job runs
 */
export declare const cleanupJobRuns: Counter<"result">;
/**
 * Records cleaned up
 */
export declare const recordsCleanedUp: Counter<"type">;
/**
 * Leader elections total (counts each time an instance becomes leader)
 */
export declare const schedulerLeaderElectionsTotal: Counter<string>;
/**
 * Is this instance the scheduler leader (1 if leader, 0 if not)
 */
export declare const schedulerIsLeader: Gauge<string>;
/**
 * Record an intent submission with all relevant labels
 */
export declare function recordIntentSubmission(tenantId: string, intentType: string | null | undefined, outcome: "success" | "duplicate" | "rejected" | "error", trustLevel?: number): void;
/**
 * Record a trust gate evaluation
 */
export declare function recordTrustGateEvaluation(tenantId: string, intentType: string | null | undefined, result: "passed" | "rejected" | "bypassed"): void;
/**
 * Record a status transition
 */
export declare function recordStatusTransition(tenantId: string, fromStatus: IntentStatus | "new", toStatus: IntentStatus): void;
/**
 * Record job processing result
 */
export declare function recordJobResult(queueName: string, result: "success" | "failure" | "retry", durationSeconds: number): void;
/**
 * Update queue gauges
 */
export declare function updateQueueGauges(queueName: string, waiting: number, active: number): void;
/**
 * Record an error
 */
export declare function recordError(errorCode: string, component: string): void;
/**
 * Record policy evaluation metrics
 */
export declare function recordPolicyEvaluation(tenantId: string, namespace: string, result: "allow" | "deny" | "escalate", durationSeconds: number, matchedCount: number): void;
/**
 * Record policy override
 */
export declare function recordPolicyOverride(tenantId: string, ruleAction: string, policyAction: string): void;
/**
 * Database operation types for labeling queries
 */
export type DbOperationType = "select" | "insert" | "update" | "delete" | "other";
/**
 * Detect operation type from SQL query string
 */
export declare function detectOperationType(sql: string): DbOperationType;
/**
 * Record a successful database query with timing
 */
export declare function recordDbQuery(operation: DbOperationType, durationSeconds: number): void;
/**
 * Record a failed database query
 */
export declare function recordDbQueryError(operation: DbOperationType, errorType: string): void;
/**
 * Update database pool connection gauges
 */
export declare function updateDbPoolMetrics(active: number, idle: number, waiting: number): void;
/**
 * Record lock contention during deduplication
 */
export declare function recordLockContention(tenantId: string, outcome: "acquired" | "timeout" | "conflict"): void;
/**
 * Record trust gate bypass
 */
export declare function recordTrustGateBypass(tenantId: string, intentType: string | null | undefined): void;
/**
 * Record deduplication attempt
 */
export declare function recordDeduplication(tenantId: string, outcome: "new" | "duplicate" | "race_resolved"): void;
/**
 * Record policy cache hit
 */
export declare function recordPolicyCacheHit(tenantId: string, namespace: string): void;
/**
 * Record policy cache miss
 */
export declare function recordPolicyCacheMiss(tenantId: string, namespace: string): void;
/**
 * Update SLA breach rate gauge
 */
export declare function updateSlaBreachRate(tenantId: string, breachRate: number): void;
/**
 * Record intent context size
 */
export declare function recordIntentContextSize(tenantId: string, intentType: string | null | undefined, sizeBytes: number): void;
/**
 * Record webhook delivery result
 */
export declare function recordWebhookDelivery(tenantId: string, eventType: string, success: boolean): void;
/**
 * Update escalation approval rate gauge
 */
export declare function updateEscalationApprovalRate(tenantId: string, approvalRate: number): void;
/**
 * Circuit breaker state numeric values for gauge
 */
export type CircuitBreakerStateType = "CLOSED" | "HALF_OPEN" | "OPEN";
/**
 * Record circuit breaker state change
 */
export declare function recordCircuitBreakerStateChange(name: string, fromState: CircuitBreakerStateType, toState: CircuitBreakerStateType): void;
/**
 * Update circuit breaker state gauge
 */
export declare function updateCircuitBreakerState(name: string, state: CircuitBreakerStateType): void;
/**
 * Record circuit breaker execution result
 */
export declare function recordCircuitBreakerExecution(name: string, result: "success" | "failure" | "rejected"): void;
/**
 * Update circuit breaker failure count gauge
 */
export declare function updateCircuitBreakerFailures(name: string, failureCount: number): void;
/**
 * Update per-service circuit breaker state gauge
 * This is the primary metric for monitoring circuit breaker state per service
 */
export declare function updateServiceCircuitBreakerState(service: string, state: CircuitBreakerStateType): void;
/**
 * Record a failure for a service's circuit breaker
 */
export declare function recordServiceCircuitBreakerFailure(service: string): void;
/**
 * Record a success for a service's circuit breaker
 */
export declare function recordServiceCircuitBreakerSuccess(service: string): void;
/**
 * Record a circuit breaker trip (circuit opening) for a service
 */
export declare function recordServiceCircuitBreakerTrip(service: string): void;
/**
 * Record a circuit breaker recovery (circuit closing from half-open) for a service
 */
export declare function recordServiceCircuitBreakerRecovery(service: string): void;
/**
 * Update the current half-open attempts gauge for a service
 */
export declare function updateServiceCircuitBreakerHalfOpenAttempts(service: string, attempts: number): void;
/**
 * Record a complete circuit breaker state change for a service
 * This is a convenience function that updates multiple metrics at once
 */
export declare function recordServiceCircuitBreakerStateChange(service: string, fromState: CircuitBreakerStateType, toState: CircuitBreakerStateType): void;
/**
 * Get all metrics as Prometheus text format
 */
export declare function getMetrics(): Promise<string>;
/**
 * Get metrics content type
 */
export declare function getMetricsContentType(): string;
//# sourceMappingURL=metrics.d.ts.map