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(metrics): init zero for request count of apis #5186

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

Haivilo
Copy link
Contributor

@Haivilo Haivilo commented Jan 17, 2025

This initializes endpoints metrics with 0 request count. This way, doing rate() in PromQL will correctly capture the rate of change. Currently, if it's the first time an endpoint returns error, metric is incremented to 1, but 0 value is not recorded. rate() will show 0 for error counts. Also imo we don't have to enumerate all http code, which spams the metrics, but we can.
Screenshot 2025-01-16 at 6 48 04 PM

@Haivilo Haivilo requested a review from a team as a code owner January 17, 2025 02:48
@Haivilo Haivilo requested review from frostming and removed request for a team January 17, 2025 02:48
@Haivilo Haivilo force-pushed the init-metric-with-zero branch from 5852691 to b3ffc74 Compare January 17, 2025 03:03
@Haivilo Haivilo merged commit 1f1d8d4 into bentoml:main Jan 17, 2025
51 of 52 checks passed
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