Edge Delta Kubernetes Metrics Source
2 minute read
Overview
You can use the Kubernetes Metrics source node to scrape certain Kubernetes metrics. By default, the node scrapes kube_state_metrics
. The kubelet
, cadvisor
, and node_exporter
metrics are excluded by default. See the metrics list.
- outgoing_data_types: metric
See Ingest Kubernetes Metrics.
Example Configuration

nodes:
- name: ed_k8s_metrics
type: ed_k8s_metrics_input
include:
- "cadvisor=.*cpu.*"
- "kubelet=.*cpu.*"
exclude:
- node_exporter
resource_fields:
pod_labels:
- app.kubernetes.io/instance
- app.kubernetes.io/name
- helm.sh/chart
- kubernetes.io/.*
pod_annotations:
- cluster-autoscaler.kubernetes.io/safe-to-evict
- cluster-autoscaler.kubernetes.io/.*
node_labels:
- beta.kubernetes.io/arch
- beta.kubernetes.io/instance-type
- eks.amazonaws.com/.*
- topology.kubernetes.io/zone
namespace_labels:
- kubernetes.io/metadata.name
- name
scrape_interval: 1m
Required Parameters
name
A descriptive name for the node. This is the name that will appear in Visual Pipelines and you can reference this node in the YAML using the name. It must be unique across all nodes. It is a YAML list element so it begins with a -
and a space followed by the string. It is a required parameter for all nodes.
nodes:
- name: <node name>
type: <node type>
type: ed_k8s_metrics_input
The type
parameter specifies the type of node being configured. It is specified as a string from a closed list of node types. It is a required parameter.
nodes:
- name: <node name>
type: <node type>
Optional Parameters
exclude and include
The include
and exclude
parameters are used to filter metrics. They are specified with Golang regex or full text.
Note: As of v1.27.0
kubelet
,cadvisor
, andnode_exporter
metrics are excluded by default.
- If neither
include
norexclude
are specified, then only the default metrics for powering the Kubernetes Overview Dashboard are ingested. - If
exclude
is specified it drops all metrics matching that the pattern. - If
include
is specified as well asexclude
, then metrics matching the pattern ininclude
are ingested unless dropped byexclude
. I.e.exclude
takes precedence.
nodes:
- name: ed_k8s_metrics
type: ed_k8s_metrics_input
include:
- "cadvisor=.*cpu.*"
- "kubelet=.*cpu.*"
exclude:
- node_exporter
resource_fields
The resource_fields
parameters define the labels and annotations to be collected as metadata fields and included. It is specified as a dictionary of regexes and is optional.
You can specify:
pod_labels
pod_annotations
node_labels
namespace_labels
nodes:
- name: ed_k8s_metrics
type: ed_k8s_metrics_input
resource_fields:
pod_labels:
- app.kubernetes.io/instance
- app.kubernetes.io/name
- helm.sh/chart
- kubernetes.io/.*
pod_annotations:
- cluster-autoscaler.kubernetes.io/safe-to-evict
- cluster-autoscaler.kubernetes.io/.*
node_labels:
- beta.kubernetes.io/arch
- beta.kubernetes.io/instance-type
- eks.amazonaws.com/.*
- topology.kubernetes.io/zone
namespace_labels:
- kubernetes.io/metadata.name
- name
scrape_interval
The scrape_interval
parameter is used to specify the interval at which the Edge Delta agent scrapes metric endpoints. It is specified as a duration and it is optional. The default is 1m.
nodes:
- name: <node name>
type: ed_k8s_metrics_input
scrape_interval: 1m