influxdata / influxdata/telegraf

feature request: (auto)collect resource labels for stackdriver resource types

Open
#7,532 2 comments 0 reactions 0 assignees View on GitHub
area/statsd discussion feature request
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

## Feature Request

Hello,

we are using **statsd input** plugin and **stackdriver output** plugin in telegraf deployed as **daemonset in kubernetes**. Our usecase is to ship custom metrics to stackdriver and we would like to identify metrics properly with ResourceType to increase metrics cardinality.

The problem I am having is that telegraf sets resource labels on the telegraf deployment which makes it impossible to set proper labels for resources other than generic_node or global.

For example for [k8s_pod](https://cloud.google.com/monitoring/api/resources#tag_k8s_pod) I am not able to provide cluster_name, pod_name nor namespace_name. Is there any way how to do this?

### Proposal:

Introduce (optional) metadata/label collectors for specific resource types on agent side.

As adhoc, right now, for example, for k8s_pod resource, we are able to get internal source IP from statsd plugin and use the IP to fetch resource labels from kubernetes API within telegraf instance.

### Current behavior:

Resource labels are hardcoded on telegraf instance therefore resource types are not very usable from my pov.

### Desired behavior:

Automatically collect resource labels instead of hardcoding them in configuration file.

I am not sure if this is still in telegraf scope tho :man_shrugging:

Contributor guide

Open the contributing guide

Research direction

Start by examining the statsd input and stackdriver output plugins, along with the existing resource-label configuration. Determine whether Kubernetes API metadata can be collected for resource types such as k8s_pod, and define the supported labels and completion criteria before proposing implementation details.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, google-cloud, kubernetes
Domain
cloud, observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.