influxdata/telegraf

Handle labels in kube_inventory input like the kubernetes input does

Open

#8,546 opened on Dec 12, 2020

View on GitHub
 (1 comment) (7 reactions) (0 assignees)Go (4,161 forks)batch import
area/k8sfeature requesthelp wantedsize/l

Repository metrics

Stars
 (9,892 stars)
PR merge metrics
 (Avg merge 2d 12h) (136 merged PRs in 30d)

Description

Feature Request

The Kubernetes input plugin can turn pod labels into tags on the kubernetes_pod_container measurement. For example, if you set label_include = ["app.kubernetes.io/name"], then all your measurements will get a tag with the value of that field.

The Kubernetes Inventory plugin also produces a measurement named kubernetes_pod_container, but this feature isn't available for that plugin. This makes it harder than necessary to aggregate across these two metrics sources (for example, to compare the kubernetes_pod_container.memory_usage_bytes field from the kubernetes plugin with the kubernetes_pod_container.resource_requests_memory_bytes field from the kube_inventory plugin.

Proposal:

Copy the label_include and label_exclude functionality from the kubernetes plugin to the kube_inventory plugin.

...or just merge them into a single plugin, if at all possible; having them as separate plugins (that can't even really be deployed together) is kind of a PITA.

Current behavior:

kube_inventory plugin doesn't allow you to turn labels into tags.

Desired behavior:

kube_inventory plugin allows you to turn labels into tags, just like the kubernetes plugin does.

Use case:

I want to build a dashboard in InfluxDB that displays current resource usage, resource request, and resource limit, all on the same graph. However, I want to be able to use a filter to limit the displayed metrics to pods of a given label value. I can already do this for the metrics generated by the kubernetes plugin (aka the resource usage), but I can't do it for metrics from the kube_inventory plugin (the requests and limits).

Contributor guide