Skip to content

VLAgent spec.k8sCollector.includePodLabels: false has no effect #2772

Open

Description

@pan93412

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 zeabur-oss/catalog#50):

spec:
  extraArgs:
    kubernetesCollector.includePodLabels: "false"

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

Activity

  1. added
    bug
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 29, 2026
    0f01793
  3. self-assigned this
    on Oct 29, 2026
  4. added
    waiting for release
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugwaiting for release

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions