Skip to content

Commit

Permalink
fix: update the volcano metric document.
Browse files Browse the repository at this point in the history
Signed-off-by: tanjie.master <tanjiemaster@gmail.com>
  • Loading branch information
fengruotj authored and tanjie.master committed Oct 22, 2024
1 parent 4773047 commit d40ef51
Showing 1 changed file with 51 additions and 33 deletions.
84 changes: 51 additions & 33 deletions docs/design/metrics.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,57 @@
## Scheduler Monitoring

## Introduction
Currently users can leverage controller logs and job events to monitor scheduler. While useful for debugging, none of this options is particularly practical for monitoring kube-batch behaviour over time. There's also requirement like to monitor kube-batch in one view to resolve critical performance issue in time [#427](https://github.com/kubernetes-sigs/kube-batch/issues/427).
Currently users can leverage controller logs and job events to monitor scheduler. While useful for debugging, none of these options is particularly practical for monitoring volcano behaviour over time. There's also requirement like to monitor volcano in one view to resolve critical performance issue in time [#427](https://github.com/kubernetes-sigs/kube-batch/issues/427).

This document describes metrics we want to add into kube-batch to better monitor performance.
This document describes metrics we want to add into volcano to better monitor performance.

## Metrics
In order to support metrics, kube-batch needs to expose a metrics endpoint which can provide golang process metrics like number of goroutines, gc duration, cpu and memory usage, etc as well as kube-batch custom metrics related to time taken by plugins or actions.

All the metrics are prefixed with `kube_batch_`.

### kube-batch execution
This metrics track execution of plugins and actions of kube-batch loop.

| Metric name | Metric type | Labels | Description |
| ----------- | ----------- | ------ | ----------- |
| e2e_scheduling_latency | histogram | | E2e scheduling latency in seconds |
| plugin_latency | histogram | `plugin`=&lt;plugin_name&gt; | Schedule latency for plugin |
| action_latency | histogram | `action`=&lt;action_name&gt; | Schedule latency for action |
| task_latency | histogram | `job`=&lt;job_id&gt; `task`=&lt;task_id&gt; | Schedule latency for each task |


### kube-batch operations
This metrics describe internal state of kube-batch.

| Metric name | Metric type | Labels | Description |
| ----------- | ----------- | ------ | ----------- |
| pod_schedule_errors | Counter | | The number of kube-batch failed due to an error |
| pod_schedule_successes | Counter | | The number of kube-batch success in scheduling a job |
| pod_preemption_victims | Counter | | Number of selected preemption victims |
| total_preemption_attempts | Counter | | Total preemption attempts in the cluster till now |
| unschedule_task_count | Counter | `job`=&lt;job_id&gt; | The number of tasks failed to schedule |
| unschedule_job_counts | Counter | | The number of job failed to schedule in each iteration |
| job_retry_counts | Counter | `job`=&lt;job_id&gt; | The number of retry times of one job |


### kube-batch Liveness
Healthcheck last time of kube-batch activity and timeout
In order to support metrics, volcano needs to expose a metrics endpoint which can provide golang process metrics like number of goroutines, gc duration, cpu and memory usage, etc as well as volcano custom metrics related to time taken by plugins or actions.

All the metrics are prefixed with `volcano_`.

### volcano execution
This metrics track execution of plugins and actions of volcano loop.

| **Metric Name** | **Metric Type** | **Labels** | **Description** |
|-------------------------------------------|-----------------|-------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| `e2e_scheduling_latency_milliseconds` | Histogram | None | End-to-end scheduling latency in milliseconds (scheduling algorithm + binding) |
| `e2e_job_scheduling_latency_milliseconds` | Histogram | None | End-to-end job scheduling latency in milliseconds |
| `e2e_job_scheduling_duration` | Gauge | `job_name`=&lt;job_name&gt;, `queue`=&lt;queue&gt;, `job_namespace`=&lt;job_namespace&gt; | End-to-end job scheduling duration |
| `e2e_job_scheduling_start_time` | Gauge | `job_name`=&lt;job_name&gt;, `queue`=&lt;queue&gt;, `job_namespace`=&lt;job_namespace&gt; | End-to-end job scheduling start time |
| `plugin_scheduling_latency_milliseconds` | Histogram | `plugin`=&lt;plugin_name&gt;, `OnSession`=&lt;OnSession&gt; | Plugin scheduling latency in milliseconds |
| `action_scheduling_latency_milliseconds` | Histogram | `action`=&lt;action_name&gt; | Action scheduling latency in milliseconds |
| `task_scheduling_latency_milliseconds` | Histogram | None | Task scheduling latency in milliseconds |


### volcano operations
This metrics describe internal state of volcano.

| **Metric Name** | **Metric Type** | **Labels** | **Description** |
|---------------------------------|-----------------|-----------------------------------------------------|-----------------------------------------------|
| `schedule_attempts_total` | Counter | `result`=&lt;result&gt; | The number of attempts to schedule pods |
| `pod_preemption_victims` | Gauge | None | The number of selected preemption victims |
| `total_preemption_attempts` | Counter | None | Total preemption attempts in the cluster |
| `unschedule_task_count` | Gauge | `job_id`=&lt;job_id&gt; | The number of tasks failed to schedule |
| `unschedule_job_counts` | Gauge | None | The number of jobs could not be scheduled |
| `queue_allocated_milli_cpu` | Gauge | `queue_name`=&lt;queue_name&gt; | Allocated CPU count for one queue |
| `queue_allocated_memory_bytes` | Gauge | `queue_name`=&lt;queue_name&gt; | Allocated memory for one queue |
| `queue_request_milli_cpu` | Gauge | `queue_name`=&lt;queue_name&gt; | Requested CPU count for one queue |
| `queue_request_memory_bytes` | Gauge | `queue_name`=&lt;queue_name&gt; | Requested memory for one queue |
| `queue_deserved_milli_cpu` | Gauge | `queue_name`=&lt;queue_name&gt; | Deserved CPU count for one queue |
| `queue_deserved_memory_bytes` | Gauge | `queue_name`=&lt;queue_name&gt; | Deserved memory for one queue |
| `queue_share` | Gauge | `queue_name`=&lt;queue_name&gt; | Share for one queue |
| `queue_weight` | Gauge | `queue_name`=&lt;queue_name&gt; | Weight for one queue |
| `queue_overused` | Gauge | `queue_name`=&lt;queue_name&gt; | Whether one queue is overused |
| `queue_pod_group_inqueue_count` | Gauge | `queue_name`=&lt;queue_name&gt; | The number of Inqueue PodGroups in this queue |
| `queue_pod_group_pending_count` | Gauge | `queue_name`=&lt;queue_name&gt; | The number of Pending PodGroups in this queue |
| `queue_pod_group_running_count` | Gauge | `queue_name`=&lt;queue_name&gt; | The number of Running PodGroups in this queue |
| `queue_pod_group_unknown_count` | Gauge | `queue_name`=&lt;queue_name&gt; | The number of Unknown PodGroups in this queue |
| `namespace_share` | Gauge | `namespace_name`=&lt;namespace_name&gt; | Deserved CPU count for one namespace |
| `namespace_weight` | Gauge | `namespace_name`=&lt;namespace_name&gt; | Weight for one namespace |
| `job_share` | Gauge | `job_id`=&lt;job_id&gt;, `job_ns`=&lt;job_ns&gt; | Share for one job |
| `job_retry_counts` | Counter | `job_id`=&lt;job_id&gt; | The number of retry counts for one job |


### volcano Liveness
Healthcheck last time of volcano activity and timeout

0 comments on commit d40ef51

Please sign in to comment.