Skip to main content

Overview

The Metrics add-on, once enabled, will send metrics from to Control Plane. This will allow you to query the Prometheus metrics managed by the Control Plane centrally in the web UI or in Grafana.

Supported Providers

  • All providers are supported

How to Enable

The Metrics add-on can be enabled for your Kubernetes cluster either during the cluster creation process or at any time thereafter. The following sections outline the methods for enabling the add-on:

At Cluster Creation

  • Through Cluster Manifest: Add the following snippet to your cluster manifest when creating the cluster:
    YAML
    spec:
      ...
      addOns:
        metrics: {}
      ...
    
  • Using the Console: If you’re creating the cluster through the console, navigate to Add-ons, find the Metrics add-on in the list of available add-ons, and toggle it on.

After Cluster Creation

If the Metrics add-on was not enabled during the cluster creation, you can still enable it using either of the following methods:

Using Manifest

Under spec.addOns in the YAML manifest of the cluster, you can edit it either by navigating to the cluster in the Console and using the Edit & Apply option for the cluster, or by applying the entire manifest using the cpln apply >_ option in the upper right corner or by using the cpln CLI. Add the following:
spec:
    addOns:
    metrics: {}

Using UI

  1. Navigate to Control Plane Console: Visit the Control Plane Console.
  2. Navigate to the Kubernetes cluster: In the Control Plane Console, navigate to Kubernetes in the left sidebar panel and click on the Kubernetes cluster for which you want to enable metrics collection.
  3. Enable Metrics: Choose Add-ons and locate the Metrics add-on from the list of available add-ons, then toggle it on.

Configuring Metrics add-on

The configuration is optional though by default nothing is collected/scraped. Here is a summary of configuration parameters available for the add-on.
...
spec:
  addOns:
    metrics:  # enables metrics collection
      kubeState: false    # collect kube-state metrics
      coreDns: false      # collect metrics from CoreDNS service
      kubelet: false      # collect low-level kublet metrics
      apiserver: false    # collect API server-level metrics
      nodeExporter: false # deploy node-exporter and collect host-level metrics
      cadvisor: false     # collect low-levelo container metrics from the kubelet
      scrapeAnnotated:         # scrape any pod annotated with prometheus.io/scrape
        intervalSeconds: 30    # how often to do do
        includeNamespaces:     # only in these namespaces
        excludeNamespaces:     # exclude certain namespaces (applied after includeNamespaces)
        retainLabels:          # pod labels to retain, by default retains all

Analyzing Metrics

For every cluster created, a new Prometheus datasource will appear in Grafana. You can use PromQL to query metrics and build dashboards.