Skip to content

Architecture

balakrishnagatla edited this page Nov 29, 2026 · 1 revision

Architecture

architecture

The pieces

  1. Providers (src/infralens/providers/) talk to one cloud each using read-only APIs and translate what they see into one standard shape, the Finding. AWS, Azure (beta), Kubernetes and a mock provider ship in the box; others plug in through the infralens.providers entry-point group.
  2. Engine (engine.py) runs the providers, applies the policy (thresholds, ignore rules, ownership tags), resolves owners from tags, and correlates each reliability alert with recent changes ("what changed?").
  3. Store (store.py, SQLite) remembers every finding across scans, so reports show only what's new or resolved, triage decisions stick, and resolved cost savings are counted as captured.
  4. Front doors: the MCP server (stdio or Streamable HTTP), the CLI, Watch Mode, and an AWS Lambda handler.

The Finding

Every provider emits the same shape, so the AI and the report never need cloud-specific logic:

Field Example
cloud, account, region aws, 123456789012, us-east-2
category savings · incident · ownership
check unattached_volume, log_error_spike, crash_loop
resource_type, resource_id ebs_volume, vol-0abc...
title, severity low · medium · high · critical
est_monthly_cost_usd 1.60
evidence numbers and log lines the AI reasons about (secrets masked)
recommendation the command a human would run; never executed
owner, team, env, tags resolved from tags

The id is a stable fingerprint of cloud, account, region, check and resource, so the same issue is tracked across scans.

Lifecycle

new → open → acknowledged / suppressed → resolved

  • A finding seen for the first time is new; seen again, open.
  • acknowledge_finding and suppress_finding (with a reason) are recorded in the store, never in the cloud.
  • When a finding disappears from a scan it is resolved. A resolved cost savings finding adds its monthly estimate to savings captured.

"What changed?" correlation

For each reliability alert, the engine looks at changes from the providers (CloudTrail write events, Azure Activity Log, Kubernetes rollouts) inside the correlation window (default 120 minutes before the alert). Suspects are ranked by:

  1. Same service or resource as the alert
  2. Changes before the alert started, over changes after it
  3. Closest in time

Noise such as console sign-ins, CloudShell heartbeats and role assumptions is filtered out. Capacity forecasts (a disk slowly filling) get no suspects, because a slow trend isn't caused by one change.

Clone this wiki locally