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(cu): add pending evals metric for alerts #1105

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bredamatt
Copy link
Contributor

@bredamatt bredamatt commented Jan 10, 2025

Added these for grafana alerting purposes.

@bredamatt bredamatt added the cu ao Compute Unit label Jan 10, 2025
@bredamatt bredamatt self-assigned this Jan 10, 2025
labelNames: ['type']
})

pendingEvaluationCounter.set({ type: 'primary' }, primaryWorkQueue.size)
Copy link
Contributor

@jfrain99 jfrain99 Jan 10, 2025

Choose a reason for hiding this comment

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

This will set the metric amount when this file is run at startup, then never again. We will need to move the sets to the location that the work queues are added to (evaluateWith, maybe?) and increment it by 1 on addition and decrement by 1 on completion.

set does not currently exist on the grafana counters. Only inc is implemented (see effects/metrics.js, counterWith). This can be implemented with inc / dec or feel free to implement set in metrics.js - up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, will adjust this accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jfrain99 Seems there is a way to listen to events on the PQueue and accordingly inc, dec the pendingEvaluationsCounter given those events take place. I've added this accordingly. Not so familiar with JS, so let me know if I need to change further.

@bredamatt bredamatt requested a review from jfrain99 January 16, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cu ao Compute Unit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants