[deckhouse] add queue head info metric and critical label for severity-tiered alerting #20476
[deckhouse] add queue head info metric and critical label for severity-tiered alerting #20476diyliv wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Deckhouse monitoring to support severity-tiered alerting for hung task queues by enriching queue-hang signals with “queue head” context and module criticality, and bumps the addon-operator dependency to a commit that provides the required metrics/labels.
Changes:
- Added a recording rule
d8:deckhouse_queue_is_hung:with_headthat joins queue length with the newdeckhouse_tasks_queue_head_infometric. - Split the existing hung-queue alert into
D8DeckhouseQueueIsHungCritical,D8DeckhouseQueueIsHung(non-critical), andD8DeckhouseQueueIsHungGlobalwith updated severities and annotations. - Updated Deckhouse alert catalog docs and Go module dependencies (
addon-operatorandgo-openapi/swag/*entries).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| modules/340-monitoring-deckhouse/monitoring/prometheus-rules/deckhouse.yaml | Adds the recording rule with head info and introduces new critical/non-critical/global queue hang alerts. |
| docs/documentation/_data/deckhouse-alerts.yml | Updates alert catalog entries to reflect the new/renamed alerts and severities. |
| go.mod | Bumps github.com/flant/addon-operator and adjusts go-openapi/swag/* requirements. |
| go.sum | Updates checksums for the new addon-operator version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| plk_labels_as_annotations: "module,task_type,hook" | ||
| summary: Critical module queue `{{ $labels.module }}` (type `{{ $labels.task_type }}`, hook `{{ $labels.hook }}`) is hung. | ||
| description: | | ||
| Queue head stayed for more than 10 minutes. Module=`{{ $labels.module }}`, task=`{{ $labels.task_type }}`, hook=`{{ $labels.hook }}`. |
There was a problem hiding this comment.
| Queue head stayed for more than 10 minutes. Module=`{{ $labels.module }}`, task=`{{ $labels.task_type }}`, hook=`{{ $labels.hook }}`. | |
| The critical module queue head has remained unchanged for more than 10 minutes. | |
| Affected queue: | |
| - Module: `{{ $labels.module }}` | |
| - Task type: `{{ $labels.task_type }}` | |
| - Hook: `{{ $labels.hook }}` | |
| To investigate the issue, check the logs of the `deckhouse` controller pods: | |
| ```bash | |
| d8 k -n d8-system logs -f -l app=deckhouse | |
| ``` |
| plk_labels_as_annotations: "instance,pod" | ||
| summary: The `{{ $labels.queue }}` Deckhouse queue is stuck with {{ $value }} pending task(s). | ||
| plk_labels_as_annotations: "module,task_type,hook" | ||
| summary: Queue `{{ $labels.module }}` (type `{{ $labels.task_type }}`, hook `{{ $labels.hook }}`) is hung. |
There was a problem hiding this comment.
| summary: Queue `{{ $labels.module }}` (type `{{ $labels.task_type }}`, hook `{{ $labels.hook }}`) is hung. | |
| summary: Module queue `{{ $labels.module }}` (type `{{ $labels.task_type }}`, hook `{{ $labels.hook }}`) is hung. |
| plk_labels_as_annotations: "module,task_type,hook" | ||
| summary: Queue `{{ $labels.module }}` (type `{{ $labels.task_type }}`, hook `{{ $labels.hook }}`) is hung. | ||
| description: | | ||
| Queue head stayed for more than 10 minutes. Module=`{{ $labels.module }}`, task=`{{ $labels.task_type }}`, hook=`{{ $labels.hook }}`. |
There was a problem hiding this comment.
| Queue head stayed for more than 10 minutes. Module=`{{ $labels.module }}`, task=`{{ $labels.task_type }}`, hook=`{{ $labels.hook }}`. | |
| The module queue head has remained unchanged for more than 10 minutes. | |
| Affected queue: | |
| - Module: `{{ $labels.module }}` | |
| - Task type: `{{ $labels.task_type }}` | |
| - Hook: `{{ $labels.hook }}` | |
| To investigate the issue, check the logs of the `deckhouse` controller pods: | |
| ```bash | |
| d8 k -n d8-system logs -f -l app=deckhouse | |
| ``` |
| Global/Parallel queue head stayed for more than 10 minutes. task=`{{ $labels.task_type }}`, hook=`{{ $labels.hook }}`. | ||
|
|
||
| To investigate the issue, check the logs by running the following command: |
There was a problem hiding this comment.
| Global/Parallel queue head stayed for more than 10 minutes. task=`{{ $labels.task_type }}`, hook=`{{ $labels.hook }}`. | |
| To investigate the issue, check the logs by running the following command: | |
| The Global/Parallel queue head has remained unchanged for more than 10 minutes. | |
| Affected queue: | |
| - Task type: `{{ $labels.task_type }}` | |
| - Hook: `{{ $labels.hook }}` | |
| To investigate the issue, check the logs of the `deckhouse` controller pods: |
| Queue head stayed for more than 10 minutes. Module=`{{ $labels.module }}`, task=`{{ $labels.task_type }}`, hook=`{{ $labels.hook }}`. | ||
| summary: | | ||
| Queue {{ $labels.module }} (type {{ $labels.task_type }}, hook {{ $labels.hook }}) is hung. |
There was a problem hiding this comment.
| Queue head stayed for more than 10 minutes. Module=`{{ $labels.module }}`, task=`{{ $labels.task_type }}`, hook=`{{ $labels.hook }}`. | |
| summary: | | |
| Queue {{ $labels.module }} (type {{ $labels.task_type }}, hook {{ $labels.hook }}) is hung. | |
| The module queue head has remained unchanged for more than 10 minutes. | |
| Affected queue: | |
| - Module: `{{ $labels.module }}` | |
| - Task type: `{{ $labels.task_type }}` | |
| - Hook: `{{ $labels.hook }}` | |
| To investigate the issue, check the logs of the `deckhouse` controller pods: | |
| ```bash | |
| d8 k -n d8-system logs -f -l app=deckhouse | |
| ``` | |
| summary: | | |
| Module queue {{ $labels.module }} (type {{ $labels.task_type }}, hook {{ $labels.hook }}) is hung. |
| module: monitoring-deckhouse | ||
| edition: ce | ||
| description: | | ||
| Queue head stayed for more than 10 minutes. Module=`{{ $labels.module }}`, task=`{{ $labels.task_type }}`, hook=`{{ $labels.hook }}`. |
There was a problem hiding this comment.
| Queue head stayed for more than 10 minutes. Module=`{{ $labels.module }}`, task=`{{ $labels.task_type }}`, hook=`{{ $labels.hook }}`. | |
| The critical module queue head has remained unchanged for more than 10 minutes. | |
| Affected queue: | |
| - Module: `{{ $labels.module }}` | |
| - Task type: `{{ $labels.task_type }}` | |
| - Hook: `{{ $labels.hook }}` | |
| To investigate the issue, check the logs of the `deckhouse` controller pods: | |
| ```bash | |
| d8 k -n d8-system logs -f -l app=deckhouse | |
| ``` |
| Global/Parallel queue head stayed for more than 10 minutes. task=`{{ $labels.task_type }}`, hook=`{{ $labels.hook }}`. | ||
|
|
||
| To investigate the issue, check the logs by running the following command: |
There was a problem hiding this comment.
| Global/Parallel queue head stayed for more than 10 minutes. task=`{{ $labels.task_type }}`, hook=`{{ $labels.hook }}`. | |
| To investigate the issue, check the logs by running the following command: | |
| The Global/Parallel queue head has remained unchanged for more than 10 minutes. | |
| Affected queue: | |
| - Task type: `{{ $labels.task_type }}` | |
| - Hook: `{{ $labels.hook }}` | |
| To investigate the issue, check the logs of the `deckhouse` controller pods: |
8910416 to
24d2e90
Compare
e053f01 to
aebb8f4
Compare
Signed-off-by: diyliv <onlogn081@gmail.com>
5e4b0e6 to
bc30520
Compare
Description
Changes in addon-operator:
deckhouse_tasks_queue_head_infowith labelsqueue,module,task_type,hook— shows what task is at the head of each non-empty queue.criticalondeckhouse_mm_module_info— value fromBasicModule.GetCritical().Why do we need it, and what problem does it solve?
deckhouse_tasks_queue_lengthexposes onlyqueue— no visibility into which task/module/hook is at the head of a hung queue. Severity is always "7" regardless of module criticality.deckhouse_mm_module_infolacks acriticallabel.This change enables severity-tiered alerting based on module criticality: critical module queues (e.g.,
cni-cilium) get severity 4, non-critical (e.g.,console) get severity 6, and global/parallel task hangs get severity 4. Operators get immediate signal about what is stuck and how important it is.Example
criticallabel ondeckhouse_mm_module_infoCritical modules (26 total):
Non-critical enabled modules (29 total):
Verified on dev cluster: 26 modules with
critical="true", 41 withcritical="false".deckhouse_tasks_queue_head_info— startup phase (non-empty queues)Captured during a deckhouse pod restart. All queue head changes were correctly reflected as the startup progressed:
Global hook task (module=""):
Parallel module run (ParallelModuleRun normalised to module=""):
Module run tasks (module=):
Module hook tasks (hook=):
deckhouse_tasks_queue_head_info— steady state (all queues empty)Verified on dev cluster: metric correctly produces series only for non-empty queues, and they expire within one scrape interval after the queue drains.
Recording rule
d8:deckhouse_queue_is_hung:with_headDuring a running
ConvergeModulestask on themainqueue:The recording rule correctly joins
deckhouse_tasks_queue_lengthwithdeckhouse_tasks_queue_head_infoon thequeuelabel and usesmin_over_time(..., __SCRAPE_INTERVAL_X_3__)to avoid flapping on short-lived queue spikes.Checklist
criticallabel andtasks_queue_head_infoverified.Changelog entries