/** * cloudwatchObservability — Generic AWS CloudWatch Logs adapter. * * Ships every `AgentfootprintEvent` to a CloudWatch Logs stream. Use * when you want agent telemetry alongside the rest of your AWS * observability stack — CloudWatch Insights queries, alarms, * cross-service correlation. Same SDK as `agentcoreObservability` * but **without** the AgentCore-specific defaults (log-stream * convention, format opinions). Use this when: * * 1. You're shipping to CloudWatch but NOT running inside Bedrock * AgentCore (most common case). * 2. You want full control over log group / stream / format and * don't need AgentCore's hosted-agent telemetry conventions. * * Subpath: `agentfootprint/observability-providers` * Peer dep: `@aws-sdk/client-cloudwatch-logs` (OPTIONAL — installed * only when this adapter is used; declared via * `peerDependenciesMeta.{name}.optional = true`). * * This module also exports the underlying base function used by * `agentcoreObservability` — keeps the per-event hot path in one * place so improvements (batching, retry, backpressure) flow to * every CloudWatch-shaped adapter automatically. * * @example * ```ts * import { cloudwatchObservability } from 'agentfootprint/observability-providers'; * import { microtaskBatchDriver } from 'footprintjs/detach'; * * agent.enable.observability({ * strategy: cloudwatchObservability({ * region: 'us-east-1', * logGroupName: '/myapp/agent-prod', * logStreamName: `${process.env.HOSTNAME}/${Date.now()}`, * }), * detach: { driver: microtaskBatchDriver, mode: 'forget' }, * }); * ``` */ import type { ObservabilityStrategy } from '../../strategies/types.js'; export interface CloudwatchObservabilityOptions { /** AWS region. Falls back to AWS_REGION / AWS_DEFAULT_REGION env. */ readonly region?: string; /** CloudWatch Logs log group. **Required.** Must exist or your IAM * role must allow `logs:CreateLogGroup`. */ readonly logGroupName: string; /** CloudWatch Logs log stream within the group. Conventionally * `/` so multi-instance deployments don't * collide. Created on first put if it doesn't exist (or your * role must allow `logs:CreateLogStream`). Defaults to * `agentfootprint`. */ readonly logStreamName?: string; /** Max events buffered before forced flush. Default 100. */ readonly maxBatchEvents?: number; /** Max payload bytes (UTF-8) buffered before forced flush. Default * 10240 (10 KB). CloudWatch hard caps at 1 MB / batch but we keep * the default low so latency stays bounded. */ readonly maxBatchBytes?: number; /** Forced-flush interval when traffic is sparse. Default 1000ms. * `0` disables time-based flush — only size triggers fire. */ readonly flushIntervalMs?: number; /** Test injection — bypasses SDK lazy-require entirely. When set, * `region` / IAM are ignored. */ readonly _client?: CloudWatchLikeClient; } export interface CloudWatchLikeClient { putLogEvents(input: { logGroupName: string; logStreamName: string; logEvents: ReadonlyArray<{ timestamp: number; message: string; }>; }): Promise; } /** * Internal: shared CloudWatch Logs base used by every adapter that * ships to CWL. `cloudwatchObservability` is the public generic * factory; `agentcoreObservability` calls this with AgentCore-flavored * defaults. * * Exported for adapter authors only — consumers should call * `cloudwatchObservability` or `agentcoreObservability` directly. * * @internal */ export declare function _buildCloudWatchObservability(opts: CloudwatchObservabilityOptions, strategyName: string): ObservabilityStrategy; /** * Generic CloudWatch Logs observability adapter. See * `CloudwatchObservabilityOptions` for the per-option contract. * * For AgentCore-specific conventions, use `agentcoreObservability` * which thin-wraps this with AgentCore-flavored defaults. */ export declare function cloudwatchObservability(opts: CloudwatchObservabilityOptions): ObservabilityStrategy; //# sourceMappingURL=cloudwatch.d.ts.map