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

Use RecentlyActive feature to only list metrics older than 3 hours when necessary #296

Merged
merged 5 commits into from
Aug 14, 2020
Merged

Use RecentlyActive feature to only list metrics older than 3 hours when necessary #296

merged 5 commits into from
Aug 14, 2020

Conversation

bemica
Copy link
Contributor

@bemica bemica commented Aug 13, 2020

I have the problem that a lot of the dimensions on my CloudWatch metrics change frequently. Because the default behaviour of listMetrics() is to return every metric that matches your query and has been updated in the last 2 weeks, this causes the scrape time to be very high. With this option, we can limit the returned metrics to only those which have been updated in the last 3 hours. I also had to update the AWS SDK to allow this, as the version currently being used doesn't have this feature

cc @brian-brazil

Nathan Beneke added 4 commits August 13, 2020 19:17
@brian-brazil
Copy link
Contributor

If we're using this it shouldn't be configurable, we already know the range_seconds in use.

@bemica
Copy link
Contributor Author

bemica commented Aug 13, 2020

So you would suggest to set this option if range_seconds < 3 hours? I guess that also makes sense

@brian-brazil
Copy link
Contributor

Yes.

@bemica
Copy link
Contributor Author

bemica commented Aug 13, 2020

@brian-brazil I agree that's a lot simpler actually. Changed it to do that and updated the test to make sure that it's actually still possible to get metrics older than 3 hours with this setup

@bemica bemica changed the title Enable recently active only option Use RecentlyActive feature to only list metrics older than 3 hours when necessary Aug 13, 2020
@bemica
Copy link
Contributor Author

bemica commented Aug 14, 2020

I see this was also talked about in this open issue but never pursued further. With regard to the concern with S3 and similar metrics, I think it's okay because for those metrics the range_seconds has to be very high anyways #134 (comment)_

@brian-brazil brian-brazil merged commit ccf38f9 into prometheus:master Aug 14, 2020
@brian-brazil
Copy link
Contributor

Thanks!

@bemica bemica deleted the enable-recently-active-only-option branch August 14, 2020 09:26
@guusvw
Copy link

guusvw commented Aug 14, 2020

Hey @brian-brazil
What is your policy on building new releases? ;)

@brian-brazil
Copy link
Contributor

As-needed basically, I've added it to my todo list.

@kjpianeta
Copy link

Hi @brian-brazil should we expect a new release with this in the next week(s), month(s)? Thanks.

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.

4 participants