Skip to content

feat(opencost): expose AWS RI/SP Athena refresh interval - #376

Open
sridhav wants to merge 1 commit into
opencost:mainfrom
sridhav:feat/aws-ri-sp-refresh-interval
Open

feat(opencost): expose AWS RI/SP Athena refresh interval#376
sridhav wants to merge 1 commit into
opencost:mainfrom
sridhav:feat/aws-ri-sp-refresh-interval

Conversation

@sridhav

@sridhav sridhav commented Jul 30, 2026

Copy link
Copy Markdown

Description

Complements two OpenCost changes that reduce AWS Athena scan cost, exposing/documenting them in the chart:

  1. RI/SP refresh interval (feat(aws): make RI/SP Athena refresh interval configurable opencost#3977) — wires a new opencost.exporter.aws.riSpRefreshRateHours value (default 1) to the AWS_RI_SP_REFRESH_RATE_HOURS environment variable on the exporter deployment. Controls how often the Reserved Instance and Savings Plan watchers refresh from Athena (previously hardcoded to 1h).
  2. Athena result-reuse caching (feat(aws): add Athena query result reuse configuration opencost#3953) — documents the resultReuseMaxAgeMinutes field in the cloudIntegrationJSON example. This field lives in cloud-integration.json (passed through opaquely by the chart), so it needs no wiring — the example just makes it discoverable.

Changes:

  • values.yaml: add opencost.exporter.aws.riSpRefreshRateHours: 1; add resultReuseMaxAgeMinutes to the cloudIntegrationJSON example
  • deployment.yaml: AWS_RI_SP_REFRESH_RATE_HOURS env sourced from that value
  • README.md: regenerated values table
  • Chart.yaml: version 2.5.28 → 2.5.29

Dependency

The AWS_RI_SP_REFRESH_RATE_HOURS env var only takes effect once an OpenCost image containing opencost/opencost#3977 ships; older images ignore it (safe to merge). The resultReuseMaxAgeMinutes field requires opencost/opencost#3953.

User Impact

Backward compatible. riSpRefreshRateHours defaults to 1, reproducing today's hourly behavior. Multi-cluster deployments sharing a single CUR export can raise it (e.g. 24) and/or set resultReuseMaxAgeMinutes to cut Athena scan cost.

Testing

  • helm lint charts/opencost
  • helm template charts/opencost | grep -A1 AWS_RI_SP_REFRESH_RATE_HOURS → renders value: "1"
  • With --set opencost.exporter.aws.riSpRefreshRateHours=24 → renders value: "24"

Wire a new opencost.exporter.aws.riSpRefreshRateHours value (default 1) to
the AWS_RI_SP_REFRESH_RATE_HOURS environment variable on the exporter
deployment. This lets operators slow the Reserved Instance and Savings Plan
Athena refresh cadence, which defaults to hourly. For multi-cluster
deployments that share a single CUR export, raising this (e.g. to 24)
substantially reduces Athena scan cost. Default of 1 preserves existing
behavior.

Requires an OpenCost image that reads AWS_RI_SP_REFRESH_RATE_HOURS
(opencost/opencost#3977); older images ignore the variable.

Also document the config-driven Athena result-reuse caching field
(resultReuseMaxAgeMinutes) in the cloudIntegrationJSON example. That field
lives in cloud-integration.json and needs no chart wiring, but the example
makes it discoverable (opencost/opencost#3953).

Bumps chart version 2.5.28 -> 2.5.29 and regenerates the README values table.

Signed-off-by: Sridhar Vemula <thewarrior.316@gmail.com>
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.

1 participant