/** * Dependency-free OTLP/HTTP telemetry for the machine Agent. * * Callers can name only reviewed operations, outcomes and lifecycle events. * There is deliberately no field for a URL, request/response body, header, * credential, tenant coordinate, command, error detail or arbitrary label. */ export declare const AGENT_TELEMETRY_OPERATIONS: readonly ["agent.heartbeat", "agent.update", "attestation.refresh", "deployment.claim", "deployment.run", "deployment.renew", "deployment.complete", "migration.claim", "migration.run", "migration.renew", "migration.complete", "provisioning.preflight", "provisioning.claim", "provisioning.apply", "provisioning.renew", "provisioning.complete", "vault.sync", "agent.other"]; export type AgentTelemetryOperation = (typeof AGENT_TELEMETRY_OPERATIONS)[number]; export declare const AGENT_TELEMETRY_OUTCOMES: readonly ["success", "idle", "refused", "retryable", "failed"]; export type AgentTelemetryOutcome = (typeof AGENT_TELEMETRY_OUTCOMES)[number]; export declare const AGENT_TELEMETRY_EVENTS: readonly ["agent.started", "agent.draining", "agent.stopped", "agent.update_prepared", "agent.update_recovered", "metal.resource.recorded", "metal.resource.unavailable", "metal.resource.paused", "metal.resource.retrying", "telemetry.queue_overflow"]; export type AgentTelemetryEvent = (typeof AGENT_TELEMETRY_EVENTS)[number]; export interface AgentTelemetryConfig { endpoint: string; serviceName: string; instanceId: string; environment: 'production' | 'development'; flushIntervalMs: number; traceSampleRatio: number; } export interface AgentOperationObservation { operation: AgentTelemetryOperation; outcome: AgentTelemetryOutcome; startedAtMs: number; durationMs: number; } export interface AgentTelemetryState { active: number; completed: number; failed: number; draining: boolean; } export interface AgentTelemetry { recordOperation(observation: AgentOperationObservation): void; recordEvent(event: AgentTelemetryEvent): void; recordState(state: AgentTelemetryState): void; flush(): Promise; close(): Promise; } type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise; export declare const AGENT_OTLP_EXPORT_TIMEOUT_MS = 5000; export declare const AGENT_OTLP_MAX_ATTEMPTS = 2; export declare const AGENT_OTLP_MAX_RETRY_DELAY_MS = 1000; export declare const AGENT_TELEMETRY_MAX_SPANS = 256; export declare const AGENT_TELEMETRY_MAX_LOGS = 64; /** Resolve once at process startup; production refuses to run without an exporter. */ export declare function resolveAgentTelemetryConfig(env?: Record): AgentTelemetryConfig | null; export declare function createAgentTelemetry(input: AgentTelemetryConfig | null, options?: { fetch?: FetchLike; warn?: (message: string) => void; now?: () => number; random?: () => number; wait?: (milliseconds: number) => Promise; }): AgentTelemetry; export {};