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

[Feature] Fetch alerts or recording rules from a Prometheus server #36

Open
aledegano opened this issue Apr 1, 2020 · 0 comments
Open

Comments

@aledegano
Copy link

First of all hello and thank you very much for sharing this very cool project!

I think it would be nice to support the ability to fetch metrics held in the Prometheus server which are not usually exposed any other way. For instance alerts and recording rules.

I have found a workaround for this use case, if anyone is interested, to scrape the /federate endpoint and passing the correct "instant vector selector" and url-encoding the query.

For instance, let's say that your metric is named candies (could be a recording rule aggregating and manipulating other primitive metrics), then you can invoke prometheus-to-cloudwatch as:

prometheus_to_cloudwatch -prometheus_scrape_url "http://localhost:9090/federate?match[]=%7B__name__%3D~%22candies.%2A%22%7D"

where the query is simply the url-encode of match[]={__name__=~"candies.*"}.

While this workaround seems to work, it makes the code not very readable and a bit hard to maintain, so perhaps this feature could be integrated directly into the code?

If you think it's a good idea to include the feature I might be able to open a PR for it.

Thank you for your feedback.

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

No branches or pull requests

1 participant