Skip to content

ADR-0022: idle-EC2-instance detection - the Critic's real job - #72

Merged
Nabzx merged 1 commit into
mainfrom
research/idle-instance-detection-71
Sep 4, 2026
Merged

Nabzx merged 1 commit into
mainfrom
research/idle-instance-detection-71

Conversation

@Nabzx

@Nabzx Nabzx commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Closes #71. Researched against the real CloudWatch/EC2 API models before deciding anything: CPUUtilization/NetworkIn/NetworkOut need no CloudWatch agent (confirmed against the model); the threshold mirrors AWS's own published Trusted Advisor convention rather than an invented number, with the exact constants flagged for re-checking before a real client ships; stop-not-terminate confirmed directly in StopInstances' own docs; check_completed here is a fourth distinct idempotency shape (state-check, since StopInstances doesn't fail on repeat); and the Critic's evidence grows real fields (launch_time, tags, metric values) so it can add genuine judgement on a case that's actually ambiguous, unlike the existing unassociated-EIP check.

Researched #71 against the real CloudWatch/EC2 API models (botocore,
not assumption) before deciding anything.

- CPUUtilization/NetworkIn/NetworkOut via GetMetricStatistics need no
  CloudWatch agent, unlike memory metrics - confirmed against the
  real service model, not assumed.
- The threshold mirrors AWS's own published Trusted Advisor
  low-utilization convention rather than a number this project
  invents - locks the shape of the rule, flags the exact constants
  for re-checking against AWS's current docs before a real client
  ships (not before this ships fake-only).
- Stop, not terminate - confirmed directly in StopInstances' own
  docs: restarts exactly as it was via StartInstances, billing stops
  immediately. Same reasoning ADR-0020 already used for Elastic IPs.
- A fourth distinct idempotency shape: StopInstances doesn't fail on
  a repeat call the way ReleaseAddress does - check_completed has to
  ask DescribeInstances whether the instance is already stopped,
  not rely on a failure as the signal.
- What the Critic is actually for here, concretely: unlike an
  unassociated EIP, "low utilization for N days" is a heuristic that
  can be wrong in nameable ways (recently launched, tagged as a
  standby) - the evidence handed to the Critic grows real fields
  (launch_time, tags, metric values) so it can add real judgement,
  not restate the rule's own boolean.

ADR-0021's "advisory only, never a veto" isn't re-litigated - still
holds exactly as locked.

Closes #71
@Nabzx
Nabzx merged commit 970cc73 into main Sep 4, 2026
7 checks passed
@Nabzx
Nabzx deleted the research/idle-instance-detection-71 branch September 4, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Research: idle-EC2-instance detection (v1.1) - metric, threshold, and the Critic's real job

1 participant