Skip to content

feat(inputs.kube_inventory): Collect metrics for native sidecar containers - #19546

Open
redbaron wants to merge 1 commit into
influxdata:masterfrom
redbaron:init-container-metrics
Open

feat(inputs.kube_inventory): Collect metrics for native sidecar containers#19546
redbaron wants to merge 1 commit into
influxdata:masterfrom
redbaron:init-container-metrics

Conversation

@redbaron

Copy link
Copy Markdown
Contributor

Summary

Collect metrics for sidecar init containers

Checklist

Related issues

resolves #19544

@telegraf-tiger telegraf-tiger Bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Aug 25, 2026
containerList[p.Status.ContainerStatuses[i].Name] = &p.Status.ContainerStatuses[i]
initContainers := make([]corev1.Container, 0, len(p.Spec.InitContainers))
for _, c := range p.Spec.InitContainers {
if c.RestartPolicy != nil && *c.RestartPolicy == corev1.ContainerRestartPolicyAlways {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to make a minimal change and include only long-running init containers, a.k.a native sidecars. I have no preference and can extend it to all init containers

@telegraf-tiger

Copy link
Copy Markdown
Contributor

Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip.
Downloads for additional architectures and packages are available below.

⚠️ This pull request increases the Telegraf binary size by 7.28 % for linux amd64 (new size: 330.7 MB, nightly size 308.2 MB)

📦 Click here to get additional PR build artifacts

Artifact URLs

. DEB . RPM . TAR . GZ . ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm darwin_arm64.tar.gz windows_arm64.zip
armel.deb armv6hl.rpm freebsd_amd64.tar.gz windows_i386.zip
armhf.deb i386.rpm freebsd_armv7.tar.gz
i386.deb ppc64le.rpm freebsd_i386.tar.gz
mips.deb riscv64.rpm linux_amd64.tar.gz
mipsel.deb s390x.rpm linux_arm64.tar.gz
ppc64el.deb x86_64.rpm linux_armel.tar.gz
riscv64.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_riscv64.tar.gz
linux_s390x.tar.gz

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @redbaron! Let's start with this and add more containers later. However, I think you should really add a word or two to the README on what is collected here. What do you think?

@srebhan srebhan self-assigned this Aug 26, 2026
@srebhan srebhan changed the title feat(kube_inventory): collect metrics for native sidecar containers feat(inputs.kube_inventory): Collect metrics for native sidecar containers Aug 26, 2026
@telegraf-tiger telegraf-tiger Bot added the plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins label Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/k8s feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kube_inventory plugin to collect init containers info

2 participants