---
title: KubeVirt Controller
description: Collect key metrics to monitor the health of your KubeVirt Controller service.
breadcrumbs: Docs > Integrations > KubeVirt Controller
---

# KubeVirt Controller
Supported OS Integration version2.3.0
## Overview{% #overview %}

This check monitors [KubeVirt Controller](https://docs.datadoghq.com/integrations/kubevirt_controller) through the Datadog Agent.

**Minimum Agent version:** 7.59.0

## Setup{% #setup %}

Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the [Autodiscovery Integration Templates](https://docs.datadoghq.com/agent/kubernetes/integrations/) for guidance on applying these instructions.

### Installation{% #installation %}

The KubeVirt Controller check is included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package. No additional installation is needed on your server.

### Configuration{% #configuration %}

The main use case to run the `kubevirt_controller` check is as a [cluster level check](https://docs.datadoghq.com/containers/cluster_agent/clusterchecks/?tab=datadogoperator).

In order to do that, you will need to update some RBAC permissions to give the `datadog-agent` service account read-only access to the`KubeVirt` resources by following the steps below:

1. Bind the `kubevirt.io:view` ClusterRole to the `datadog-agent` service account:

```yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: datadog-agent-kubevirt
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: kubevirt.io:view
subjects:
  - kind: ServiceAccount
  name: datadog-agent
  namespace: default
```
Annotate the pods template of your `virt-controller` deployment by patching the `KubeVirt` resource as follows:
```yaml
apiVersion: kubevirt.io/v1
kind: KubeVirt
metadata:
  name: kubevirt
  namespace: kubevirt
spec:
  certificateRotateStrategy: {}
  configuration: {}
  customizeComponents:
    patches:
    - resourceType: Deployment
        resourceName: virt-controller
        patch: '{"spec": {"template":{"metadata":{"annotations":{ "ad.datadoghq.com/virt-controller.check_names": "[\"kubevirt_controller\"]", "ad.datadoghq.com/virt-controller.init_configs": "[{}]", "ad.datadoghq.com/virt-controller.instances": "[{ \"kubevirt_controller_metrics_endpoint\": \"https://%%host%%:%%port%%/metrics\",\"kubevirt_controller_healthz_endpoint\": \"https://%%host%%:%%port%%/healthz\", \"kube_namespace\":\"%%kube_namespace%%\", \"kube_pod_name\":\"%%kube_pod_name%%\", \"tls_verify\": \"false\"}]"}}}}}'
        type: strategic
```

Replace `<DD_CLUSTER_NAME>` with the name you want for your cluster.

### Validation{% #validation %}

[Run the Cluster Agent's `clusterchecks` subcommand](https://docs.datadoghq.com/containers/troubleshooting/cluster-and-endpoint-checks/#dispatching-logic-in-the-cluster-agent) inside your Cluster Agent container and look for the `kubevirt_controller` check under the Checks section.

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **kubevirt\_controller.can\_connect**(gauge)                                                        | Value of 1 if the agent can connect to the KubeVirt Controller, and 0 otherwise.                                                                                                                                                                 |
| **kubevirt\_controller.virt\_controller.leading\_status**(gauge)                                    | Indication for an operating virt-controller.                                                                                                                                                                                                     |
| **kubevirt\_controller.virt\_controller.ready\_status**(gauge)                                      | Indication for a virt-controller that is ready to take the lead.                                                                                                                                                                                 |
| **kubevirt\_controller.vm.error\_status\_last\_transition\_timestamp\_seconds.count**(count)        | Virtual Machine last transition timestamp to error status.*Shown as second*                                                                                                                                                                      |
| **kubevirt\_controller.vm.migrating\_status\_last\_transition\_timestamp\_seconds.count**(count)    | Virtual Machine last transition timestamp to migrating status.*Shown as second*                                                                                                                                                                  |
| **kubevirt\_controller.vm.non\_running\_status\_last\_transition\_timestamp\_seconds.count**(count) | Virtual Machine last transition timestamp to paused/stopped status.*Shown as second*                                                                                                                                                             |
| **kubevirt\_controller.vm.running\_status\_last\_transition\_timestamp\_seconds.count**(count)      | Virtual Machine last transition timestamp to running status.*Shown as second*                                                                                                                                                                    |
| **kubevirt\_controller.vm.starting\_status\_last\_transition\_timestamp\_seconds.count**(count)     | Virtual Machine last transition timestamp to starting status.*Shown as second*                                                                                                                                                                   |
| **kubevirt\_controller.vmi.migrations\_in\_pending\_phase**(gauge)                                  | Number of current pending migrations.                                                                                                                                                                                                            |
| **kubevirt\_controller.vmi.migrations\_in\_running\_phase**(gauge)                                  | Number of current running migrations.                                                                                                                                                                                                            |
| **kubevirt\_controller.vmi.migrations\_in\_scheduling\_phase**(gauge)                               | Number of current scheduling migrations.                                                                                                                                                                                                         |
| **kubevirt\_controller.vmi.non\_evictable**(gauge)                                                  | Indication for a VirtualMachine that its eviction strategy is set to Live Migration but is not migratable.                                                                                                                                       |
| **kubevirt\_controller.vmi.number\_of\_outdated**(gauge)                                            | Indication for the total number of VirtualMachineInstance workloads that are not running within the most up-to-date version of the virt-launcher environment.                                                                                    |
| **kubevirt\_controller.vmi.phase\_count**(gauge)                                                    | Sum of VMIs per phase and node. phase can be one of the following: [Pending, Scheduling, Scheduled, Running, Succeeded, Failed, Unknown].                                                                                                        |
| **kubevirt\_controller.vmi.phase\_transition\_time\_from\_creation\_seconds.bucket**(count)         | Histogram of VM phase transitions duration from creation time in seconds.*Shown as second*                                                                                                                                                       |
| **kubevirt\_controller.vmi.phase\_transition\_time\_from\_creation\_seconds.count**(count)          | Histogram of VM phase transitions duration from creation time in seconds.*Shown as second*                                                                                                                                                       |
| **kubevirt\_controller.vmi.phase\_transition\_time\_from\_creation\_seconds.sum**(count)            | Histogram of VM phase transitions duration from creation time in seconds.*Shown as second*                                                                                                                                                       |
| **kubevirt\_controller.vmi.phase\_transition\_time\_from\_deletion\_seconds.bucket**(count)         | Histogram of VM phase transitions duration from deletion time in seconds.*Shown as second*                                                                                                                                                       |
| **kubevirt\_controller.vmi.phase\_transition\_time\_from\_deletion\_seconds.count**(count)          | Histogram of VM phase transitions duration from deletion time in seconds.*Shown as second*                                                                                                                                                       |
| **kubevirt\_controller.vmi.phase\_transition\_time\_from\_deletion\_seconds.sum**(count)            | Histogram of VM phase transitions duration from deletion time in seconds.*Shown as second*                                                                                                                                                       |
| **kubevirt\_controller.vmi.phase\_transition\_time\_seconds.bucket**(count)                         | Histogram of VM phase transitions duration between different phases in seconds.*Shown as second*                                                                                                                                                 |
| **kubevirt\_controller.vmi.phase\_transition\_time\_seconds.count**(count)                          | Histogram of VM phase transitions duration between different phases in seconds.*Shown as second*                                                                                                                                                 |
| **kubevirt\_controller.vmi.phase\_transition\_time\_seconds.sum**(count)                            | Histogram of VM phase transitions duration between different phases in seconds.*Shown as second*                                                                                                                                                 |
| **kubevirt\_controller.workqueue.adds.count**(count)                                                | Total number of adds handled by workqueue*Shown as item*                                                                                                                                                                                         |
| **kubevirt\_controller.workqueue.depth**(gauge)                                                     | Current depth of workqueue*Shown as item*                                                                                                                                                                                                        |
| **kubevirt\_controller.workqueue.longest\_running\_processor\_seconds**(gauge)                      | How many seconds has the longest running processor for workqueue been running.*Shown as second*                                                                                                                                                  |
| **kubevirt\_controller.workqueue.queue\_duration\_seconds.bucket**(count)                           | How long an item stays in workqueue before being requested.*Shown as second*                                                                                                                                                                     |
| **kubevirt\_controller.workqueue.queue\_duration\_seconds.count**(count)                            | How long an item stays in workqueue before being requested.*Shown as second*                                                                                                                                                                     |
| **kubevirt\_controller.workqueue.queue\_duration\_seconds.sum**(count)                              | How long an item stays in workqueue before being requested.*Shown as second*                                                                                                                                                                     |
| **kubevirt\_controller.workqueue.retries.count**(count)                                             | Total number of retries handled by workqueue.                                                                                                                                                                                                    |
| **kubevirt\_controller.workqueue.unfinished\_work\_seconds**(gauge)                                 | How many seconds of work has done that is in progress and hasn't been observed by work_duration. Large values indicate stuck threads. One can deduce the number of stuck threads by observing the rate at which this increases.*Shown as second* |
| **kubevirt\_controller.workqueue.work\_duration\_seconds.bucket**(count)                            | How long in seconds processing an item from workqueue takes.*Shown as second*                                                                                                                                                                    |
| **kubevirt\_controller.workqueue.work\_duration\_seconds.count**(count)                             | How long in seconds processing an item from workqueue takes.*Shown as second*                                                                                                                                                                    |
| **kubevirt\_controller.workqueue.work\_duration\_seconds.sum**(count)                               | How long in seconds processing an item from workqueue takes.*Shown as second*                                                                                                                                                                    |

### Events{% #events %}

The KubeVirt Controller integration does not include any events.

### Service Checks{% #service-checks %}

The KubeVirt Controller integration does not include any service checks.

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
