feat(opencost): expose AWS RI/SP Athena refresh interval - #376
Open
sridhav wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Complements two OpenCost changes that reduce AWS Athena scan cost, exposing/documenting them in the chart:
opencost.exporter.aws.riSpRefreshRateHoursvalue (default1) to theAWS_RI_SP_REFRESH_RATE_HOURSenvironment variable on the exporter deployment. Controls how often the Reserved Instance and Savings Plan watchers refresh from Athena (previously hardcoded to 1h).resultReuseMaxAgeMinutesfield in thecloudIntegrationJSONexample. This field lives incloud-integration.json(passed through opaquely by the chart), so it needs no wiring — the example just makes it discoverable.Changes:
values.yaml: addopencost.exporter.aws.riSpRefreshRateHours: 1; addresultReuseMaxAgeMinutesto thecloudIntegrationJSONexampledeployment.yaml:AWS_RI_SP_REFRESH_RATE_HOURSenv sourced from that valueREADME.md: regenerated values tableChart.yaml: version 2.5.28 → 2.5.29Dependency
The
AWS_RI_SP_REFRESH_RATE_HOURSenv var only takes effect once an OpenCost image containing opencost/opencost#3977 ships; older images ignore it (safe to merge). TheresultReuseMaxAgeMinutesfield requires opencost/opencost#3953.User Impact
Backward compatible.
riSpRefreshRateHoursdefaults to1, reproducing today's hourly behavior. Multi-cluster deployments sharing a single CUR export can raise it (e.g.24) and/or setresultReuseMaxAgeMinutesto cut Athena scan cost.Testing
helm lint charts/opencosthelm template charts/opencost | grep -A1 AWS_RI_SP_REFRESH_RATE_HOURS→ rendersvalue: "1"--set opencost.exporter.aws.riSpRefreshRateHours=24→ rendersvalue: "24"