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

Add increase operation to calc Total triggered deploys #5595

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Warashi
Copy link
Contributor

@Warashi Warashi commented Feb 21, 2025

What this PR does:

This PR fixes the Grafana dashboard to use the increase operation when calculating the total triggered deployments in the last 24 hours.

Why we need it:

The metric grpcapi_create_deployment_total is a counter metric, so we have to use the increase operation to view it correctly.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?: Yes

  • How are users affected by this change:
    The control plane managers who use the monitoring feature.

  • Is this breaking change:

  • How to migrate (if breaking change):

@Warashi Warashi marked this pull request as ready for review February 21, 2025 02:16
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 26.25%. Comparing base (ad00a56) to head (4b55444).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5595      +/-   ##
==========================================
- Coverage   26.25%   26.25%   -0.01%     
==========================================
  Files         472      472              
  Lines       50388    50388              
==========================================
- Hits        13230    13228       -2     
- Misses      36097    36100       +3     
+ Partials     1061     1060       -1     

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

khanhtc1202
khanhtc1202 previously approved these changes Feb 21, 2025
Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

Nice catch 👍

@Warashi Warashi enabled auto-merge (squash) February 21, 2025 02:38
@@ -531,7 +531,7 @@
"targets": [
{
"exemplar": true,
"expr": "sum by (project) (grpcapi_create_deployment_total)",
"expr": "sum by (project) (increase(grpcapi_create_deployment_total[24h]))",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the increase of a counter metric must be an integer, but I'll add the ceil operation for safety.

@@ -531,7 +531,7 @@
"targets": [
{
"exemplar": true,
"expr": "sum by (project) (grpcapi_create_deployment_total)",
"expr": "sum by (project) (round(increase(grpcapi_create_deployment_total[24h])))",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found some floating-point numbers in the results, and adding round behaves as expected.

@Warashi Warashi requested a review from khanhtc1202 February 21, 2025 04:10
Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants