Repository navigation
Description
Problem Description
The spans and the OTLP log records of the devops-cli pods name the wrong cluster. All 1,705 roadmap-service spans of 2026-11-11 03:50Z-04:04Z have k8s.cluster.name=minikube. The runner OTLP log records have k8s_cluster_name=minikube. The workstation spans have homelab-k3s, which is the cluster name that the monitoring stack uses (k8s/monitoring/k8s-monitoring-values.yaml, cluster.name). The pod spans also have no k8s.namespace.name.
Cause: _detect_k8s_context in src/devops_cli/telemetry/tracer.py reads K8S_CONTEXT and POD_NAMESPACE from the environment first. No pod spec in k8s/devops/ sets them. Then the tracer uses the setting k8s.context, whose default is minikube (CONST_K8S_MINIKUBE_CONTEXT).
No code change is necessary. Each devops-cli pod spec sets the two values:
K8S_CONTEXT: the cluster name of the monitoring stack.POD_NAMESPACE: the Downward API (metadata.namespace). The runner CronJob template is the exception: the admission policyroadmap-service-jobsrefuses a Job env entry withvalueFrom, so the template sets the namespace as a plain value.
The pods are the roadmap-service Deployment, the mcp-server Deployment, the CronJobs devops-cli and devops-cli-runner (the runner Job template), and the WorkflowTemplate devops-cli-rag-ingest.
Reproduction Steps
- In Grafana Explore, run the TraceQL
{ resource.service.name = "roadmap-service" } | count_over_time() by (resource.k8s.cluster.name). - See that each span has
minikube.
Expected vs Actual Behavior
Expected: the spans and log records of the devops pods have k8s.cluster.name=homelab-k3s and k8s.namespace.name=devops.
Actual: k8s.cluster.name=minikube, and no k8s.namespace.name.
Acceptance
- A check of the
k8srow ofdevops cifails when a devops-cli container in the render ofk8s/devopshas noK8S_CONTEXTequal to the monitoring cluster name, or noPOD_NAMESPACEthat gives the namespace of its object. - After the rollout, TraceQL
{ resource.service.name = "roadmap-service" && resource.k8s.cluster.name = "minikube" }finds no new span.
Logs, Traces, or Terminal Output
Evidence: the observability study of 2026-11-11 (skeptic item W13, practice item P15). The study measured the span counts with TraceQL { } | count_over_time() by (resource.service.name, resource.k8s.cluster.name).
Out of scope: a per-pod service.instance.id and k8s.pod.name (the router change and #2536 own them).
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(k8s)scope of the title gives the scope.Telemetry labels are wrong but the service still functions; this is a correctness issue in observability data.Incorrect cluster and namespace labels mislead debugging and monitoring queries for all devops pods.No code change needed; only two env vars added to existing pod specs plus a CI check.Both involve the k8s.context setting, but #172 adds the setting and its default; the candidate sets the correct env var values on pod specs to override that default in telemetry.devops-cli-service commentedon Nov 11, 2026
Released in v0.112.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.112.0
devops-cli-service commentedon Nov 11, 2026
Live since 2026-11-11 14:13 UTC