/**
 * INTENT Distributed Tracing - OpenTelemetry Integration
 *
 * Provides distributed tracing for intent processing workflows.
 * Enables end-to-end visibility across queue workers and API calls.
 */
import { type Span, type Tracer, type Context } from '@opentelemetry/api';
import type { Intent, IntentStatus } from '../common/types.js';
/**
 * Get the intent tracer
 */
export declare function getTracer(): Tracer;
/**
 * Span attribute names for intent operations
 */
export declare const IntentAttributes: {
    readonly INTENT_ID: "intent.id";
    readonly INTENT_TYPE: "intent.type";
    readonly INTENT_STATUS: "intent.status";
    readonly INTENT_PRIORITY: "intent.priority";
    readonly TENANT_ID: "tenant.id";
    readonly ENTITY_ID: "entity.id";
    readonly TRUST_LEVEL: "trust.level";
    readonly ESCALATION_ID: "escalation.id";
    readonly ESCALATION_REASON: "escalation.reason";
    readonly ESCALATION_STATUS: "escalation.status";
    readonly QUEUE_NAME: "queue.name";
    readonly JOB_ID: "job.id";
};
/**
 * Create a span for intent submission
 */
export declare function traceIntentSubmission<T>(tenantId: string, entityId: string, intentType: string | null | undefined, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Create a span for queue job processing
 */
export declare function traceQueueJob<T>(queueName: string, jobId: string, intentId: string, fn: (span: Span) => Promise<T>, parentContext?: Context): Promise<T>;
/**
 * Create a span for trust evaluation
 */
export declare function traceTrustEvaluation<T>(intentId: string, tenantId: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Create a span for rule evaluation
 */
export declare function traceRuleEvaluation<T>(intentId: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Create a span for escalation creation
 */
export declare function traceEscalationCreate<T>(intentId: string, tenantId: string, reason: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Create a span for escalation resolution
 */
export declare function traceEscalationResolve<T>(escalationId: string, resolution: 'approved' | 'rejected', fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Create a span for decision making
 */
export declare function traceDecision<T>(intentId: string, tenantId: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Add intent attributes to current span
 */
export declare function addIntentAttributes(span: Span, intent: Intent): void;
/**
 * Add trust attributes to current span
 */
export declare function addTrustAttributes(span: Span, trustLevel: number, trustScore?: number): void;
/**
 * Record a status transition event
 */
export declare function recordStatusTransitionEvent(span: Span, fromStatus: IntentStatus | 'new', toStatus: IntentStatus): void;
/**
 * Record an evaluation result event
 */
export declare function recordEvaluationEvent(span: Span, evaluationType: 'trust' | 'rules' | 'policy', result: 'passed' | 'failed' | 'escalated', details?: Record<string, string | number | boolean>): void;
/**
 * Extract trace context for propagation to queue jobs
 */
export declare function extractTraceContext(): Record<string, string>;
/**
 * Inject trace context from carrier into context
 */
export declare function injectTraceContext(_carrier: Record<string, string>): Context;
/**
 * Span attribute names for additional tracing operations
 */
export declare const AdditionalAttributes: {
    readonly DEDUPE_HASH: "dedupe.hash";
    readonly DEDUPE_FOUND: "dedupe.found";
    readonly LOCK_KEY: "lock.key";
    readonly LOCK_ACQUIRED: "lock.acquired";
    readonly LOCK_TIMEOUT_MS: "lock.timeout_ms";
    readonly CRYPTO_OPERATION: "crypto.operation";
    readonly CRYPTO_SIZE_BYTES: "crypto.size_bytes";
    readonly CRYPTO_SUCCESS: "crypto.success";
    readonly POLICY_COUNT: "policy.count";
    readonly POLICY_MATCHED_COUNT: "policy.matched_count";
    readonly POLICY_NAMESPACE: "policy.namespace";
    readonly POLICY_FINAL_ACTION: "policy.final_action";
    readonly WEBHOOK_ID: "webhook.id";
    readonly WEBHOOK_URL_REDACTED: "webhook.url_redacted";
    readonly WEBHOOK_STATUS_CODE: "webhook.status_code";
    readonly WEBHOOK_SUCCESS: "webhook.success";
    readonly WEBHOOK_EVENT_TYPE: "webhook.event_type";
};
/**
 * Create a span for deduplication check
 */
export declare function traceDedupeCheck<T>(tenantId: string, entityId: string, hash: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Create a span for lock acquisition
 */
export declare function traceLockAcquire<T>(tenantId: string, lockKey: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Create a span for encryption operation (async)
 */
export declare function traceEncrypt<T>(sizeBytes: number, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Create a span for encryption operation (sync)
 */
export declare function traceEncryptSync<T>(sizeBytes: number, fn: (span: Span) => T): T;
/**
 * Create a span for decryption operation (async)
 */
export declare function traceDecrypt<T>(sizeBytes: number, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Create a span for decryption operation (sync)
 */
export declare function traceDecryptSync<T>(sizeBytes: number, fn: (span: Span) => T): T;
/**
 * Create a span for policy evaluation
 */
export declare function tracePolicyEvaluate<T>(intentId: string, tenantId: string, namespace: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Create a span for webhook delivery
 */
export declare function traceWebhookDeliver<T>(webhookId: string, url: string, eventType: string, fn: (span: Span) => Promise<T>): Promise<T>;
/**
 * Record policy evaluation result on span
 */
export declare function recordPolicyEvaluationResult(span: Span, policyCount: number, matchedCount: number, finalAction: string): void;
/**
 * Record webhook delivery result on span
 */
export declare function recordWebhookResult(span: Span, success: boolean, statusCode?: number): void;
/**
 * Record lock acquisition result on span
 */
export declare function recordLockResult(span: Span, acquired: boolean, timeoutMs?: number): void;
/**
 * Record deduplication check result on span
 */
export declare function recordDedupeResult(span: Span, found: boolean): void;
//# sourceMappingURL=tracing.d.ts.map