Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gcp+aws): Add last_scrape_time metric #159

Merged
merged 3 commits into from
May 2, 2024
Merged

Conversation

Pokom
Copy link
Contributor

@Pokom Pokom commented Apr 30, 2024

In order to better track freshness of data, this PR adds a few more operational metrics:

  • cloudcost_exporter_collector_last_scrape_time
  • cloudcost_exporter_last_scrape_time

The intent of these is to export in unix time the last time a scrape was performed. This can be used to alert in prometheus when the last_scrape_time was say > 60m.

This also implements in AWS the operational metrics that GCP implemented so that we have feature parity between the two. In the future it would make sense to generalize this to a common interface so that new providers do not need to implement the same metrics.

In order to better track freshness of data, this PR adds a few more
operational metrics:
- `cloudcost_exporter_collector_last_scrape_time`
- `cloudcost_exporter_last_scrape_time`

The intent of these is to export in unix time the last time a scrape was
performed. This can be used to alert in prometheus when the
last_scrape_time was say > 60m.

This also implements in AWS the operational metrics that GCP
implemented so that we have feature parity between the two. In the
future it would make sense to generalize this to a common interface so
that new providers do not need to implement the same metrics.
@Pokom Pokom requested review from the-it and logyball April 30, 2024 18:42
@Pokom
Copy link
Contributor Author

Pokom commented Apr 30, 2024

I bundled into this change adding some operational metrics to AWS(akin to #105 but not completely implemented). I'm okay splitting the AWS changes off into a separate PR if we'd prefer to keep it as small as possible.

Copy link
Member

@the-it the-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Pokom Pokom merged commit 4fba148 into main May 2, 2024
1 check passed
@Pokom Pokom deleted the feat/last-scraped-metric branch May 2, 2024 17:44
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.

2 participants