/**
 * Auto-Instrumentation Configuration
 *
 * Configures automatic instrumentation for common libraries and
 * provides custom instrumentation for Vorion security operations.
 *
 * @packageDocumentation
 */
import { Instrumentation } from '@opentelemetry/instrumentation';
import { context, type Span, type Attributes } from '@opentelemetry/api';
/**
 * Instrumentation configuration options
 */
export interface InstrumentationConfig {
    /** Enable HTTP instrumentation */
    http?: boolean | HttpInstrumentationConfig;
    /** Enable Fastify instrumentation */
    fastify?: boolean | FastifyInstrumentationConfig;
    /** Enable Redis instrumentation */
    redis?: boolean | RedisInstrumentationConfig;
    /** Enable PostgreSQL instrumentation */
    postgres?: boolean | PostgresInstrumentationConfig;
    /** Enable filesystem instrumentation */
    fs?: boolean;
    /** Enable DNS instrumentation */
    dns?: boolean;
    /** Custom instrumentations to add */
    custom?: Instrumentation[];
}
/**
 * HTTP instrumentation configuration
 */
export interface HttpInstrumentationConfig {
    /** Ignore specific URL paths */
    ignoreIncomingPaths?: string[];
    /** Ignore outgoing requests to specific URLs */
    ignoreOutgoingUrls?: string[];
    /** Request hook for adding attributes */
    requestHook?: (span: Span, request: unknown) => void;
    /** Response hook for adding attributes */
    responseHook?: (span: Span, response: unknown) => void;
}
/**
 * Fastify instrumentation configuration
 */
export interface FastifyInstrumentationConfig {
    /** Request hook for adding attributes */
    requestHook?: (span: Span, request: unknown) => void;
}
/**
 * Redis instrumentation configuration
 */
export interface RedisInstrumentationConfig {
    /** Enable command tracing */
    dbStatementSerializer?: (command: string, args: unknown[]) => string;
    /** Response hook */
    responseHook?: (span: Span, response: unknown) => void;
}
/**
 * PostgreSQL instrumentation configuration
 */
export interface PostgresInstrumentationConfig {
    /** Enhance spans with query information */
    enhancedDatabaseReporting?: boolean;
    /** Add query text to spans (be careful with sensitive data) */
    addSqlText?: boolean;
}
/**
 * Get all instrumentations based on configuration
 */
export declare function getInstrumentations(config?: InstrumentationConfig): Instrumentation[];
/**
 * Get Node.js auto-instrumentations with Vorion-specific configuration
 */
export declare function getNodeInstrumentations(): Instrumentation[];
/**
 * Security operation types
 */
export type SecurityOperationType = 'authentication' | 'authorization' | 'policy-evaluation' | 'trust-evaluation' | 'escalation' | 'audit' | 'encryption' | 'token-validation' | 'mfa-verification' | 'session-validation';
/**
 * Security operation context
 */
export interface SecurityOperationContext {
    /** Operation type */
    operationType: SecurityOperationType;
    /** Tenant ID */
    tenantId?: string;
    /** Entity/User ID */
    entityId?: string;
    /** Intent ID (if applicable) */
    intentId?: string;
    /** Additional attributes */
    attributes?: Attributes;
}
/**
 * Instrument a security operation
 *
 * @param ctx - Security operation context
 * @param fn - Function to instrument
 * @returns Result of the function
 */
export declare function instrumentSecurityOperation<T>(ctx: SecurityOperationContext, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Instrument authentication operation
 */
export declare function instrumentAuth<T>(tenantId: string, entityId: string, method: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Instrument authorization operation
 */
export declare function instrumentAuthz<T>(tenantId: string, entityId: string, resource: string, action: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Instrument policy evaluation
 */
export declare function instrumentPolicyEval<T>(tenantId: string, intentId: string, namespace: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Instrument trust evaluation
 */
export declare function instrumentTrustEval<T>(tenantId: string, entityId: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Instrument escalation handling
 */
export declare function instrumentEscalation<T>(tenantId: string, intentId: string, escalationId: string, reason: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Instrument token validation
 */
export declare function instrumentTokenValidation<T>(tokenType: 'access' | 'refresh' | 'api-key', fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Instrument MFA verification
 */
export declare function instrumentMfaVerification<T>(tenantId: string, entityId: string, method: 'totp' | 'webauthn' | 'sms' | 'email', fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Record security event on span
 */
export declare function recordSecurityEvent(span: Span, event: string, attributes?: Attributes): void;
/**
 * Record authentication success
 */
export declare function recordAuthSuccess(span: Span, method: string): void;
/**
 * Record authentication failure
 */
export declare function recordAuthFailure(span: Span, method: string, reason: string): void;
/**
 * Record policy denial
 */
export declare function recordPolicyDenial(span: Span, policyId: string, reason: string): void;
/**
 * Record security violation
 */
export declare function recordSecurityViolation(span: Span, violationType: string, details: Record<string, string | number | boolean>): void;
/**
 * Instrument a database query
 */
export declare function instrumentDbQuery<T>(operation: string, table: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Instrument a cache operation
 */
export declare function instrumentCacheOp<T>(operation: 'get' | 'set' | 'del' | 'exists', key: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Instrument queue job production
 */
export declare function instrumentQueueProduce<T>(queueName: string, jobType: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Instrument queue job consumption
 */
export declare function instrumentQueueConsume<T>(queueName: string, jobId: string, fn: (span: Span) => Promise<T>, parentContext?: typeof context): Promise<T>;
//# sourceMappingURL=instrumentation.d.ts.map