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

api: add metrics endpoint #630

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Conversation

lewismiddleton
Copy link
Contributor

Adds a metrics endpoint that computes updated metric values on each request.

On each request we:

  • fetch runner groups from Redis
  • get all runners for each group
  • update a Gauge for the runners_count on each group
  • render out the prometheus metrics in standard format

Resolves #625

@lewismiddleton lewismiddleton requested a review from a team as a code owner July 9, 2024 16:52
@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.60%. Comparing base (b83bf37) to head (0e29a3b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #630      +/-   ##
==========================================
+ Coverage   86.43%   86.60%   +0.16%     
==========================================
  Files          33       34       +1     
  Lines        1386     1403      +17     
==========================================
+ Hits         1198     1215      +17     
  Misses        188      188              
Flag Coverage Δ
api 64.71% <100.00%> (+0.86%) ⬆️
unit 67.92% <0.00%> (-0.84%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@tcarmet tcarmet left a comment

Choose a reason for hiding this comment

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

LGTM 👌 Thanks for this contribution! I look forward to see it live.

Adds a metrics endpoint that computes updated metric values on each
request.

On each request we:
- fetch runner groups from Redis
- get all runners for each group
- update a Gauge for the runners_count on each group
- render out the prometheus metrics in standard format
@lewismiddleton
Copy link
Contributor Author

Ah I got a lint error, I've just pushed the auto-fix.

@tcarmet tcarmet merged commit 86ae1ba into scality:main Jul 11, 2024
9 of 11 checks passed
@lewismiddleton lewismiddleton deleted the redis-metrics branch September 23, 2024 14:05
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.

Add metrics endpoint
3 participants