---
title: CoreDNS
slug: coredns
docTags: 
createdAt: 2024-10-03T07:37:47.841Z
---

OpsVerse's [Kubernetes agent](https://docs.opsverse.io/install-the-opsverse-agent#VEqXM) can be used to collect metrics from CoreDNS running in your Kubernetes Cluster.

### Prerequisites

- OpsVerse Agent should be running in the same cluster where CoreDNS pods are running

## Configuration

Add the following `YAML` snippet to the agent's `values.yaml` and run the agent based on these [instructions](https://docs.opsverse.io/install-the-opsverse-agent#VEqXM).

```yaml
observe-agent:
  victoria-metrics-agent:
    extraScrapeConfigs:
      - job_name: 'coredns'
        kubernetes_sd_configs:
          - role: pod
        relabel_configs:
          - source_labels: [__meta_kubernetes_pod_label_k8s_app]
            action: keep
            regex: kube-dns
```

:::hint{type="warning"}
If you already have an `extraScrapeConfigs` block defined in `victoria-metrics-agent` in your values.yaml, you can simply append the job to the end of the existing config
:::

## Visualization

You can use the[ community-provided CoreDNS Grafana dashboard](https://grafana.com/grafana/dashboards/14981-coredns/) to visualise your CoreDNS metrics

![CoreDNS Dashboard](https://api.archbee.com/api/optimize/ibl_P5JvALfaq64lBhWg8-1VqNx51udVpN_u4cPX9AP-20241003-075256.png "CoreDNS Dashboard")

