The alert said the pods were down. Kubernetes disagreed.
Monitoring systems are supposed to tell us when something is wrong.
But what happens when Prometheus reports that application pods are missing, while Kubernetes shows that those exact pods are running and healthy?
Is the application actually failing?
Is kube-state-metrics not exporting the expected data?
Is Prometheus missing a metric?
Or is Thanos returning an incomplete result?
These questions became the starting point of an investigation involving false-positive alerts in an EMEA PROD Kubernetes cluster.
The affected workloads belonged to the vs-cmdb namespace, specifically the Connector and Preprocessor components.
The interesting part was that the Kubernetes workloads appeared healthy, but the Prometheus alert expression continued evaluating as true.
This investigation demonstrates why understanding PromQL evaluation is just as important as understanding Kubernetes workload health.
The central lesson: An alert that detects a missing metric does not necessarily detect a failed application.
1. Incident Overview
What happened?
Critical monitoring alerts were firing for the following workloads:
- vs-cmdb Connector
- vs-cmdb Preprocessor
The alerts were based on the following PromQL expression:
absent(
kube_pod_status_phase{
namespace="vs-cmdb",
phase="Running",
pod=~".*vs-cmdb-connector.*"
}
)The expected behavior was straightforward:
If no matching running-pod metric exists, generate an alert.
However, the investigation revealed an inconsistency.
| Component | Observation |
|---|---|
| Kubernetes pods | Running and healthy |
| Application status | No corresponding application failure identified |
kube_pod_info | Metrics available |
kube_pod_status_phase | Query returned an empty vector |
| ServiceMonitor | Existing |
| kube-state-metrics | Target and configuration investigated |
| Prometheus/Thanos query | Expected phase series unavailable |
The investigation was limited to the EMEA PROD environment.
At this stage, the evidence pointed toward a monitoring-data problem rather than an application outage.
However, the exact underlying reason for the missing metric series was not yet established.
2. Understanding the Telemetry Architecture
Before investigating the alert, we need to understand how Kubernetes object state becomes a Prometheus metric.
Kubernetes itself does not expose every object as a Prometheus time series.
An exporter such as kube-state-metrics watches Kubernetes API objects and exposes metrics representing their state.
Prometheus scrapes the exporter endpoint, stores the samples and makes them available to PromQL queries.
In environments using Thanos, the query layer can additionally retrieve and aggregate data from multiple Prometheus instances.
Telemetry data flow
Each stage is an independent troubleshooting boundary.
A metric can be missing because:
- The exporter did not generate it.
- The exporter configuration excluded it.
- Prometheus did not scrape it.
- Relabeling removed it.
- The metric was not retained or exposed through the queried data source.
- The query used unexpected labels or a different time range.
An existing ServiceMonitor only establishes part of the configuration path. It does not prove successful end-to-end ingestion of every expected metric.
3. Understanding the Two Metrics
One of the most useful findings during this investigation was the difference between:
kube_pod_infoand:
kube_pod_status_phaseThey are not interchangeable.
kubepodinfo
This metric exposes general information about Kubernetes pods.
Depending on the available labels, it can provide:
- Pod name.
- Namespace.
- Node assignment.
- Pod IP.
- Host IP.
- Pod UID.
Example:
kube_pod_info{
namespace="vs-cmdb"
}This helps establish whether pod information is available in the monitoring system.
kubepodstatus_phase
This metric represents the current Kubernetes pod phase.
Its phase label can contain:
- Pending
- Running
- Succeeded
- Failed
- Unknown
Example:
kube_pod_status_phase{
namespace="vs-cmdb",
phase="Running"
}The metric is exposed as a gauge with phase information.
For a given pod, phase series indicate the corresponding phase state.
Why the difference matters
Consider this hypothetical result:
| Metric | Query result |
|---|---|
kube_pod_info | Series available |
kube_pod_status_phase | No matching series |
This tells us that the monitoring system has some information about the pod, but the expected phase metric is not available through that query.
It does not prove that the pod is stopped.
It also does not, by itself, establish why the phase series is missing.
This distinction was central to our investigation.
4. Root Cause Analysis: Understanding absent()
The most important part of this incident was understanding the behavior of Prometheus's absent() function.
Consider:
absent(
kube_pod_status_phase{
namespace="vs-cmdb",
phase="Running"
}
)What does this expression do?
It checks whether its input vector contains any matching time series.
There are two possible outcomes.
Scenario A: Matching series exist
kube_pod_status_phase{
namespace="vs-cmdb",
phase="Running"
}Example result:
kube_pod_status_phase{
namespace="vs-cmdb",
pod="vs-cmdb-connector-abc123",
phase="Running"
} 1In this case:
absent(kube_pod_status_phase{
namespace="vs-cmdb",
phase="Running"
})Returns an empty vector.
The alert condition does not fire.
Scenario B: No matching series exist
Suppose the query returns:
Empty vectorThen:
absent(kube_pod_status_phase{
namespace="vs-cmdb",
phase="Running"
})Returns a value of 1.
This is the behavior that caused the alert to fire.
Visualizing absent()
The key distinction is that absent() detects the absence of a matching series, not the underlying health of the Kubernetes object.
That is why the alert could fire while the actual workloads were running.
5. Reconstructing the Investigation
Now let's walk through the investigation in the same order an SRE would perform it during a production incident.
Step 1: Verify the application state directly
We first needed to establish whether the application pods were actually down.
kubectl get pods -n vs-cmdb -o wideFor a more focused investigation:
kubectl get pods -n vs-cmdb \
| grep -E 'vs-cmdb-connector|vs-cmdb-preprocessor'Then inspect individual pods:
kubectl describe pod <pod-name> -n vs-cmdbWhat we wanted to establish:
- Pod phase.
- Container readiness.
- Restart counts.
- Recent events.
- Node assignment.
The Kubernetes checks showed that the affected workloads were running and healthy.
This was our first indication that the alert did not represent an actual application outage.
Step 2: Query kubepodinfo
Next, we checked whether the pod information metric was available.
kube_pod_info{
namespace="vs-cmdb",
pod=~".*vs-cmdb-connector.*"
}The query returned data.
This established that the monitoring system could expose pod information for the relevant namespace and workload pattern.
It did not yet explain the missing phase metric.
Step 3: Query kubepodstatus_phase
We then queried the expected phase metric.
kube_pod_status_phase{
namespace="vs-cmdb",
phase="Running",
pod=~".*vs-cmdb-connector.*"
}The result was:
Empty vectorThis was the critical observation.
The alert was based on this same metric family.
Because the query returned no matching series, absent() evaluated to 1.
Step 4: Verify the ServiceMonitor
The next investigation boundary was kube-state-metrics scraping.
We checked whether the expected ServiceMonitor existed.
kubectl get servicemonitor -A \
| grep kube-state-metricsWe also inspected its configuration:
kubectl describe servicemonitor \
orbit-monitoring-kube-state-metrics \
-n orbit-monitoringThe ServiceMonitor existed.
We then checked the associated service and endpoints:
kubectl get svc -A | grep kube-state-metricskubectl get endpoints -A | grep kube-state-metricsFinally, we inspected the Prometheus target state and configuration.
The existence of the ServiceMonitor was useful evidence, but it was not sufficient to explain why the phase series was unavailable.
Step 5: Compare the monitoring pipeline
At this point, we had established:
- Kubernetes showed healthy pods.
kube_pod_inforeturned data.kube_pod_status_phasereturned no matching series.- The kube-state-metrics ServiceMonitor existed.
- The issue was observed in the EMEA PROD monitoring path.
The next step was to investigate where the metric disappeared.
Potential investigation boundaries included:
- kube-state-metrics exporter output.
- Metric allowlists and configuration.
- Prometheus scrape and relabeling.
- Scrape errors and sample ingestion.
- Thanos query selection and data availability.
- Namespace, cluster and pod label matching.
These are diagnostic possibilities, not confirmed causes in this incident.
6. Where Can a Kubernetes Metric Disappear?
This is where the investigation becomes especially interesting.
The telemetry pipeline contains multiple components, and checking only one of them can lead to an incorrect conclusion.
Layer 1: kube-state-metrics
kube-state-metrics watches Kubernetes objects and generates corresponding metrics.
The first question should be:
Does the metric exist on the exporter's own /metrics endpoint?
For example:
kubectl port-forward \
-n orbit-monitoring \
svc/orbit-monitoring-kube-state-metrics \
8080:8080Then:
curl -s http://localhost:8080/metrics \
| grep kube_pod_status_phaseThe exact namespace, service and port should be verified in the deployed configuration.
If the metric is missing here, investigate exporter configuration, resource permissions, version and metric generation.
Layer 2: Prometheus scraping
If the metric exists on the exporter endpoint, check whether Prometheus actually scrapes it.
Inspect targets through the Prometheus UI.
Useful API endpoint:
/api/v1/targetsCheck:
- Target health.
- Scrape errors.
- Last scrape time.
- Scrape duration.
- Scrape URL.
- Discovered labels.
An exporter endpoint returning metrics does not guarantee that Prometheus has successfully ingested them.
Layer 3: Relabeling and metric filtering
Prometheus configurations can drop metrics through metric relabeling.
For example:
metric_relabel_configs:
- source_labels: [__name__]
regex: "kube_pod_status_phase"
action: dropThis is an illustrative example of how a metric could be excluded.
Other filtering mechanisms can also affect which metrics reach storage.
Layer 4: Thanos query path
In a Thanos-based environment, do not assume that an empty query result automatically means the exporter is not generating the metric.
Inspect the Prometheus data directly, where accessible, and compare it with the Thanos query result.
Check:
- Cluster labels.
- Replica labels.
- Query time range.
- Data source selection.
- Store availability.
- Historical versus current samples.
The objective is to identify the exact stage at which the expected series becomes unavailable.
7. Why This Was an EMEA PROD-Specific Investigation
An important detail in the incident was the environment scope.
The issue was observed in EMEA PROD rather than being established as a universal problem across every cluster.
That distinction changes how we investigate.
If every cluster reports the same missing metric, a shared exporter configuration or alert rule may be responsible.
If only one environment is affected, compare the monitoring pipeline between the affected and healthy environments.
Useful comparison dimensions include:
| Area | What to compare |
|---|---|
| kube-state-metrics | Version and arguments |
| ServiceMonitor | Labels, selectors and endpoints |
| Prometheus | Scrape configuration |
| Relabeling | Metric inclusion/exclusion |
| Thanos | Store selection and query labels |
| Alert rules | Expression and environment selectors |
| Kubernetes | Namespace and workload labels |
The goal is not to assume that EMEA PROD has a configuration defect.
The goal is to identify what differs between environments and whether that difference explains the missing series.
8. Improving the Alert Design
The investigation also raises an important question:
Should an application availability alert depend entirely on a single metric being present?
Consider the original expression:
absent(
kube_pod_status_phase{
namespace="vs-cmdb",
phase="Running",
pod=~".*vs-cmdb-connector.*"
}
)This expression is useful for detecting missing matching series.
However, it combines two different operational concerns:
- Application workload state.
- Monitoring data availability.
These should ideally have separate alerts.
Alert 1: Detect pods that are not running
A more explicit approach is to compare desired workload replicas against available replicas.
For example:
kube_deployment_spec_replicas{
namespace="vs-cmdb",
deployment="vs-cmdb-connector"
}
>
kube_deployment_status_replicas_available{
namespace="vs-cmdb",
deployment="vs-cmdb-connector"
}This is an illustrative deployment-level availability check.
It requires both metrics to be available and should be supplemented with a separate missing-telemetry alert.
Alert 2: Detect missing kube-state-metrics data
A separate telemetry alert can monitor the exporter or scrape pipeline.
For example:
up{
job=~".*kube-state-metrics.*"
} == 0This detects a scrape target reporting as down.
However, a target being up does not guarantee that every expected metric family is present.
A more complete monitoring strategy should also verify expected metric availability.
Alert 3: Detect missing expected metric series
For a narrowly scoped metric-presence check:
absent(
kube_pod_status_phase{
namespace="vs-cmdb",
phase="Running"
}
)This can be useful, but it should be named and routed as a telemetry or metric-availability alert rather than automatically interpreted as proof that the application is down.
A useful design principle is:
Application health alerts should measure application health. Monitoring health alerts should measure monitoring health.
9. Recommended SRE Troubleshooting Checklist
When an alert says that Kubernetes pods are missing but the workloads appear healthy, follow this sequence.
| Order | Investigation | Command / Query |
|---|---|---|
| 1 | Verify pods | kubectl get pods -n vs-cmdb -o wide |
| 2 | Inspect pod details | kubectl describe pod |
| 3 | Query pod information | kube_pod_info |
| 4 | Query pod phase | kube_pod_status_phase |
| 5 | Check alert expression | absent(...) |
| 6 | Verify ServiceMonitor | kubectl get servicemonitor -A |
| 7 | Verify service endpoints | kubectl get endpoints -A |
| 8 | Inspect exporter metrics | /metrics endpoint |
| 9 | Check Prometheus targets | /api/v1/targets |
| 10 | Compare Thanos and Prometheus | Identical query, labels and time range |
This sequence prevents an SRE from immediately restarting healthy application workloads when the actual problem may be somewhere in the observability pipeline.
10. Incident Conclusion
The investigation established an important discrepancy between the Kubernetes control plane and the monitoring data.
The affected vs-cmdb Connector and Preprocessor workloads were healthy.
However, the expected kube_pod_status_phase series was unavailable through the relevant Prometheus/Thanos query.
Because the alert used absent(), the empty query result caused the alert condition to evaluate as true.
The existing kube-state-metrics ServiceMonitor and availability of kube_pod_info provided additional evidence that the issue needed to be investigated at the metric-family and telemetry-pipeline level.
The precise underlying cause of the missing phase metric was not conclusively established in the available investigation evidence.
Therefore, the defensible RCA conclusion is:
The false-positive application alert was caused by missing expected monitoring time series, not by a confirmed failure of the Kubernetes workloads. The underlying reason for the missing metric remained subject to further telemetry-pipeline investigation.
11. Final Takeaways
There is a significant difference between these statements:
- The pod is not running.
- Prometheus cannot find a metric indicating that the pod is running.
They are not equivalent.
An empty vector is a valid PromQL result. It can be caused by missing telemetry, label mismatches, scrape problems or query-path issues.
The most important lesson from this investigation is to validate application state independently before taking action based on monitoring alerts.
In production SRE operations, observability systems must be monitored just as carefully as the applications they observe.
A healthy application with broken telemetry is still an operational problem, but it is a very different incident from an application outage.
---
References and Further Reading
- Prometheus — Querying Functions and absent()
- Prometheus — Querying Basics
- Kubernetes — Metrics for Kubernetes Object States
- kube-state-metrics — Pod Metrics
- Thanos — Query Component
This article distinguishes confirmed investigation observations from potential causes and recommended diagnostic steps. Example configurations and queries are illustrative and should be adapted to the deployed monitoring architecture.
