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

Fix prometheus endpoints #628

Merged
merged 4 commits into from
Feb 7, 2024
Merged

Fix prometheus endpoints #628

merged 4 commits into from
Feb 7, 2024

Conversation

kickster97
Copy link
Member

@kickster97 kickster97 commented Feb 1, 2024

WHAT is this pull request doing?

Fixes the PrometheusController,
Previously the iterator vhosts from target_vhosts() was misused, resulting in the value being 0 for many metrics.
Now we let vhosts be an array, instead of an iterator. This allows us to iterate over it many times, as we do in register_routes.

Also: Adds a type to the metrics that were missing it, so that datadog is able to scrape everything.

HOW can this pull request be tested?

accumulate some queues, messages, exchanges etc. and check the endpoint at
http://localhost:15672/metrics

@jage
Copy link
Contributor

jage commented Feb 1, 2024

Possible to add specs for the metrics (i.e. integration style, read the prometheus end-point and verify the numbers)? We have a simple parser in Crystal https://github.com/84codes/prometheus.cr

Copy link
Member

@viktorerlingsson viktorerlingsson left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Agree with @jage , would be great to verify with a spec or two!

@kickster97
Copy link
Member Author

kickster97 commented Feb 6, 2024

Seems like the prometheus parser is not used in any of our projects, has no starts of forks.. @jage is the intention to maintain it?
A solution could be to just lift in the parser code into lavinmq (its not that many lines of code), as i'm having trouble making it work as a dependency..

@jage
Copy link
Contributor

jage commented Feb 7, 2024

Seems like the prometheus parser is not used in any of our projects, has no starts of forks.. @jage is the intention to maintain it?

No, provided as-is. There's another non-public parser available, but not sure what's the best fit here.

Copy link
Member

@viktorerlingsson viktorerlingsson left a comment

Choose a reason for hiding this comment

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

LGTM!

(but run crystal tool format)

@kickster97 kickster97 merged commit 5755846 into main Feb 7, 2024
23 of 26 checks passed
@kickster97 kickster97 deleted the fix_prometheus_endpoints branch February 7, 2024 15:45
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.

3 participants