chore(engine): add base set of new scheduler metrics #19913
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
I had to refactor
workerConna little for this; I isolated those changes into the first commit for easier review.This PR adds a base set of scheduler metrics for monitoring:
loki_engine_scheduler_tasks_total: Counter for task transitions (by state)loki_engine_scheduler_tasks_inflight: Gauge for current tasks (by state)loki_engine_scheduler_streams_total: Counter for stream transitions (by state)loki_engine_scheduler_streams_inflight: Gaguge for current streams (by state)loki_engine_scheduler_workers: Gauge for current workers (by state)loki_engine_scheduler_threads: Gauge for current threads (by state)loki_engine_scheduler_connections_total: Counter for total incoming connsloki_engine_scheduler_connections_active: Gauge for current active connsloki_engine_scheduler_task_queue_seconds: Tracks how long tasks are enqueuedloki_engine_scheduler_task_exec_seconds: Tracks how long tasks take to finishWorker and thread state is a new concept, introduced for monitoring. They are in one of the following states:
busy: A task is executingready: Tasks have been requestedidle: No tasks have been requested or are runningThe overall worker state is inferred from the state of its threads, in precedence order of
busy>ready>idle.