VLAgent `spec.k8sCollector.includePodLabels: false` has no effect
Maintainers usually reply within 1 day
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
- Domain
- devops, infrastructure
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
- 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 - Look at the DaemonSet's container args: there is no
-kubernetesCollector.includePodLabelsflag. - 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'. - 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
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from VictoriaMetrics/operator
-
Bug: VMRule `spec.groups[].tenant` should accept an integer, not only a stringPossibly taken @megative claimed this 15 days ago. Openenhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
VictoriaMetrics/operator#2608 · 5 comments ·
Maintainers usually reply within 1 day
-
VMAlert datasource bearer token isn't documentedPossibly taken @Haleygo claimed this 10 days ago. Opendocs
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
VictoriaMetrics/operator#2365 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
VMAgent: StatefulSet pods are periodically recreated by operator although StatefulSet revision remains unchangedPossibly taken @Haleygo claimed this 1 day ago. Openquestion
VictoriaMetrics/operator#2769 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
VictoriaMetrics/operator#2768 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
VictoriaMetrics/operator#2766 ·
Maintainers usually reply within 1 day
All issues in VictoriaMetrics/operator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
agent-butler-finding bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jordansmall/spindrift#6161 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open-telemetry/opentelemetry-go-compile-instrumentation#1635 ·
Maintainers usually reply within 2 days
-
C-bug O-community X-blathers-untriaged
Difficulty 1/5 Under an hour Newbie friendliness 84/100
cockroachdb/cockroach#176210 · 1 comment ·
-
gps
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day