Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

VLAgent `spec.k8sCollector.includePodLabels: false` has no effect

Open Beginner friendly
#2,772 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@sarankumar1325 is already working on this.

Since Oct 29, 2026.

  • #2773 by @sarankumar1325 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go, kubernetes

Research direction

Read internal/controller/operator/factory/vlagent/vlagent.go and trace how spec.k8sCollector.includePodLabels becomes container arguments. Check the flag's default in app/vlagent/kubernetescollector and look for existing tests covering VLAgent argument generation. Done when setting includePodLabels to false produces -kubernetesCollector.includePodLabels=false; verify with the relevant argument-generation tests.

Written by the indexing model from the issue text.

Description

Describe the bug

spec.k8sCollector.includePodLabels: false on a VLAgent has no effect. Pod labels are still collected.

internal/controller/operator/factory/vlagent/vlagent.go adds -kubernetesCollector.includePodLabels only when the value is true (ptr.Deref(..., true)), and passes nothing when it is false. vlagent (app/vlagent/kubernetescollector) defaults the flag to true, so false is never applied.

To Reproduce
  1. Apply a VLAgent with the collector on and pod labels off:
    apiVersion: operator.victoriametrics.com/v1
    kind: VLAgent
    metadata:
      name: collector
    spec:
      k8sCollector:
        enabled: true
        includePodLabels: false
      remoteWrite:
        - url: http://vlsingle-example:9428/internal/insert
    
  2. Look at the DaemonSet's container args: there is no -kubernetesCollector.includePodLabels flag.
  3. Run a pod with a label, e.g. kubectl run demo --image=busybox --labels=team=a -- sh -c 'while true; do echo hi; sleep 5; done'.
  4. Query VictoriaLogs for its lines: they carry kubernetes.pod_labels.team.
Expected behavior

The operator passes -kubernetesCollector.includePodLabels=false when the field is false, and the lines carry no kubernetes.pod_labels.* fields.

Version
  • Kubernetes: K3s v1.36.5+k3s1
  • vm-operator: v0.75.0 (the same code is on the default branch)
  • vlagent: v1.52.0
Additional context

Workaround: set the flag through extraArgs (see https://github.com/zeabur-oss/catalog/pull/50):

spec:
  extraArgs:
    kubernetesCollector.includePodLabels: "false"

With it, the DaemonSet runs with -kubernetesCollector.includePodLabels=false and no line has pod labels.

Dominant language
Go
Stars
595
Forks
242
Avg merge
1d 11h
Merged PRs (30d)
58

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from VictoriaMetrics/operator

All issues in VictoriaMetrics/operator

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.