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 queue size metrics with priorities #2301

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

syphar
Copy link
Member

@syphar syphar commented Nov 5, 2023

Looking at queue sizes I saw that these are "hanging" when going to zero:

grafik

When a certain priority has a queued item at any point in time, it's added to the metric. When we don't update the value any more, the last value is used. With the old logic, that would mean when the queued item count for a certain priority goes to zero after being >0, the old value is kept.

The first solution is to just reset the metric before inserting all current values. We see how this would look like in the end of the screenshot, where I did a server restart, so the metric content was reset.

What is not so nice with this is that it leads to gaps in the graph, which also makes using some of the prometheus formular harder. So for the priorities we use the most, I insert 0 as value, if there is nothing queued.

@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Nov 5, 2023
src/metrics/mod.rs Outdated Show resolved Hide resolved
@syphar syphar force-pushed the fix-queue-metricvs branch 2 times, most recently from 04f06e4 to 5c0fc96 Compare November 8, 2023 18:08
@syphar syphar requested a review from Nemo157 November 8, 2023 18:13
Copy link
Member

@Nemo157 Nemo157 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 despite CI being green the tests didn't actually run cause of #2307

@syphar syphar merged commit a7020da into rust-lang:master Nov 9, 2023
7 checks passed
@syphar syphar deleted the fix-queue-metricvs branch November 9, 2023 10:49
@github-actions github-actions bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Nov 9, 2023
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Nov 9, 2023
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