oblivion
BlogsPortfolioContact
cloud Dispatch14 min read

When Prometheus Lies: Debugging False-Positive Kubernetes Alerts Caused by Missing Metrics

A real-world Kubernetes observability investigation into false-positive Prometheus alerts caused by missing kube-state-metrics series, absent() evaluation, and discrepancies between Kubernetes API state and monitoring data.

alert Expressionabsent(kube_pod_status_phase)
workload StatePods Running (Healthy in K8s API)
telemetry AnomalyMissing kube_pod_status_phase series in Thanos
resolutionScrape pipeline validation & absent() guard rails

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:

PROMQL
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.

ComponentObservation
Kubernetes podsRunning and healthy
Application statusNo corresponding application failure identified
kube_pod_infoMetrics available
kube_pod_status_phaseQuery returned an empty vector
ServiceMonitorExisting
kube-state-metricsTarget and configuration investigated
Prometheus/Thanos queryExpected 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

Technical Architecture FlowMermaid.js
Rendering architectural diagram...
Figure 1: Kubernetes Telemetry Path and Prometheus Absent Alert Discrepancy
Download .excalidrawExcalidraw Vector
Kubernetes APIPods are Runningkube-state-metricsexports object statePrometheus scrape /Thanos query pathAlert expressionabsent(kube_pod_status_phase)No matching seriesabsent() returns 1Alert firesPod reported missingCross-checkkubectl + kube_pod_infoObserved realityPods healthy / RunningInvestigate metric pathexporter → scrape → labels→ remote read / queryConfirm scopewhich metric, labels,cluster and time range?A missing time series is not equivalent to a failed Kubernetes workload.

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:

PROMQL
kube_pod_info

and:

PROMQL
kube_pod_status_phase

They 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:

PROMQL
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:

PROMQL
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:

MetricQuery result
kube_pod_infoSeries available
kube_pod_status_phaseNo 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:

PROMQL
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

PROMQL
kube_pod_status_phase{
  namespace="vs-cmdb",
  phase="Running"
}

Example result:

TEXT
kube_pod_status_phase{
  namespace="vs-cmdb",
  pod="vs-cmdb-connector-abc123",
  phase="Running"
} 1

In this case:

PROMQL
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:

TEXT
Empty vector

Then:

PROMQL
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()

Technical Architecture FlowMermaid.js
Rendering architectural diagram...

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.

BASH
kubectl get pods -n vs-cmdb -o wide

For a more focused investigation:

BASH
kubectl get pods -n vs-cmdb \
  | grep -E 'vs-cmdb-connector|vs-cmdb-preprocessor'

Then inspect individual pods:

BASH
kubectl describe pod <pod-name> -n vs-cmdb

What 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.

PROMQL
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.

PROMQL
kube_pod_status_phase{
  namespace="vs-cmdb",
  phase="Running",
  pod=~".*vs-cmdb-connector.*"
}

The result was:

TEXT
Empty vector

This 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.

BASH
kubectl get servicemonitor -A \
  | grep kube-state-metrics

We also inspected its configuration:

BASH
kubectl describe servicemonitor \
  orbit-monitoring-kube-state-metrics \
  -n orbit-monitoring

The ServiceMonitor existed.

We then checked the associated service and endpoints:

BASH
kubectl get svc -A | grep kube-state-metrics
BASH
kubectl get endpoints -A | grep kube-state-metrics

Finally, 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:

  1. Kubernetes showed healthy pods.
  2. kube_pod_info returned data.
  3. kube_pod_status_phase returned no matching series.
  4. The kube-state-metrics ServiceMonitor existed.
  5. 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:

BASH
kubectl port-forward \
  -n orbit-monitoring \
  svc/orbit-monitoring-kube-state-metrics \
  8080:8080

Then:

BASH
curl -s http://localhost:8080/metrics \
  | grep kube_pod_status_phase

The 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:

TEXT
/api/v1/targets

Check:

  • 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:

YAML
metric_relabel_configs:
  - source_labels: [__name__]
    regex: "kube_pod_status_phase"
    action: drop

This 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:

AreaWhat to compare
kube-state-metricsVersion and arguments
ServiceMonitorLabels, selectors and endpoints
PrometheusScrape configuration
RelabelingMetric inclusion/exclusion
ThanosStore selection and query labels
Alert rulesExpression and environment selectors
KubernetesNamespace 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:

PROMQL
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:

  1. Application workload state.
  2. 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:

PROMQL
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:

PROMQL
up{
  job=~".*kube-state-metrics.*"
} == 0

This 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:

PROMQL
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.

When an alert says that Kubernetes pods are missing but the workloads appear healthy, follow this sequence.

OrderInvestigationCommand / Query
1Verify podskubectl get pods -n vs-cmdb -o wide
2Inspect pod detailskubectl describe pod
3Query pod informationkube_pod_info
4Query pod phasekube_pod_status_phase
5Check alert expressionabsent(...)
6Verify ServiceMonitorkubectl get servicemonitor -A
7Verify service endpointskubectl get endpoints -A
8Inspect exporter metrics/metrics endpoint
9Check Prometheus targets/api/v1/targets
10Compare Thanos and PrometheusIdentical 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

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.

Referenced In & Suggested Next Reads

Bidirectionally cross-referenced across technical domains.