Skip to content

Contributing to Kubeflow community-distribution: Restoring Prometheus metrics behind empty Kiali graphs

Interactive Diagram

새 탭 ↗

Open source contributions are not only about shipping large features. Quite often, the most valuable work is to install the software for real, notice that an expected signal is missing, trace the regression all the way down, and restore it with a small but precise patch.

That was exactly this case. After installing Kubeflow community-distribution, I noticed that Kiali graphs stayed empty. Tracing the issue led to an Istio mesh patch used for oauth2-proxy, which had accidentally dropped the default Prometheus metrics provider. The fix was simply to restore that missing piece.

The symptom was straightforward.

  • After installing Kubeflow, Kiali service graphs were empty
  • Prometheus was running, but the core traffic metrics Kiali expects were missing
  • In particular, istio_requests_total was absent from the queries being inspected

Kiali builds graphs from Istio telemetry metrics. A primary input for HTTP/gRPC traffic is istio_requests_total; TCP traffic also uses istio_tcp_sent_bytes_total. Missing HTTP request metrics are therefore an important clue, but an empty graph alone does not establish a telemetry-generation failure.[7]

At first glance this looks like a Kiali issue, but the real problem was lower in the stack: Istio mesh configuration.

Root Cause: Replacing Mesh Config Dropped the Default Metrics Provider

Section titled “Root Cause: Replacing Mesh Config Dropped the Default Metrics Provider”

The offending file was:

  • common/oauth2-proxy/components/istio-external-auth-patches/patches/cm.enable-oauth2-proxy.yaml

This component patches the Istio mesh config to enable external auth via oauth2-proxy. ConfigMap.data.mesh is a string containing YAML, not a nested YAML object. Replacing that string does not automatically deep-merge the fields inside it. The regression identified in the PR was the omission of the following base-install setting from the replacement string:[1][2]

defaultProviders:
metrics:
- prometheus

The PR describes this omission as preventing istiod from configuring the istio.stats telemetry filter in sidecar listeners, with request metrics disappearing as a result.[1] However, omitting the field does not imply the same outcome in every Istio deployment. In the Istio 1.30.2 source, mergeMetrics uses defaultProviders.metrics as its default, but an applicable explicit Telemetry.metrics.providers selection can change that choice. The disabled setting in metric overrides also has a separate effect.[4][5]

The following is the causal path described for the PR’s configuration, not a new experiment confirming the state of a running proxy.

auth patch for oauth2-proxy applied
-> defaultProviders.metrics disappears from mesh config
-> no applicable Telemetry provider selection replaces it
-> istio.stats telemetry filter not configured, per the PR
-> istio_requests_total is never produced
-> Kiali graphs stay empty

The public PR records base commit 3b51d86f8c267b206f067660c7d2e6de1c565585, fix head 98d8e1f35e1c221457a9e570d870b2bc8186bcee, and merge commit c71e7454b28568cd0307dfe64381d7e6d87e80b9.[1] At the base commit, common/istio/istio-install/base/install.yaml contains the pilot:1.30.2 and proxyv2:1.30.2 images and defaultProviders.metrics: [prometheus]. Istio 1.30.2 is therefore verifiable for this source snapshot.[2]

That does not establish the commit or proxy version installed in my cluster at the time. This post contains no sanitized record establishing its installation revision, additional overlays, or applicable Telemetry overrides. The retrospective is consequently limited to the oauth2-proxy mesh-string replacement regression in PR #3532, not a recommendation to apply the same patch to empty graphs in every Kubeflow release or Istio version. The sidecar diagnostics below are not directly transferable to ambient/waypoint deployments.

The change itself was tiny. I restored the missing field so the patched config matches the base install again.

data:
mesh: |-
defaultConfig:
discoveryAddress: istiod.istio-system.svc:15012
proxyMetadata: {}
tracing: {}
defaultProviders:
metrics:
- prometheus
enablePrometheusMerge: true
rootNamespace: istio-system

That was just three inserted lines. But bugs like this are rarely about code volume. The important part is the debugging path that explains why the telemetry disappeared in the first place.

Source changes and runtime recovery are different evidence

Section titled “Source changes and runtime recovery are different evidence”

The public diff confirms one file with three insertions and zero deletions. The verification presented in the PR checks whether defaultProviders is restored in the output of kustomize build example. The discussion contains a maintainer’s /lgtm and /approve, and the merge commit contains the restored field.[1][3]

This is evidence that the configuration fix was accepted upstream. This post has no before/after proxy metric output under comparable traffic, Prometheus query results, or recovery screenshot from Kiali; the public discussion supplies no separate runtime measurements either. No new request counts, recovery times, or success rates are invented, and merge is not substituted for runtime-recovery verification. Demonstrating recovery requires sanitized evidence of the installation revision and observation time, actual requests, proxy emission, scraping, and Kiali display within the same observation window.

Read-only branches for narrowing an empty graph

Section titled “Read-only branches for narrowing an empty graph”

These are unexecuted diagnostic examples. The kubectl and istioctl commands illustrate reads in an authorized context, with no apply, restart, patch, or port-forward operations. Angle-bracket values are placeholders to replace with your own targets; prometheus.example.com is a documentation-reserved domain. Do not interpret command failures or insufficient permissions as missing metrics. Real output can contain internal identifiers and should not be pasted unchanged into a public record.

Establish whether requests occurred in the observation window

Section titled “Establish whether requests occurred in the observation window”

Use existing request records and observation timestamps to check for HTTP/gRPC requests that actually traversed the mesh within Kiali’s selected time window and namespaces. A Ready Pod or a running Prometheus server is not evidence of requests. With no requests or mismatched times, do not diagnose a provider regression first. Reproduction requiring traffic generation needs a separately approved test; this post neither supplies nor executes traffic-generating commands. For TCP-only traffic, do not diagnose failure from an HTTP counter alone.[7]

Compare the installation render with live mesh configuration

Section titled “Compare the installation render with live mesh configuration”

First record the local source checkout commit and the overlay used for installation. The render below is scoped to the PR’s example path and istio-system/istio; substitute the installed overlay and ConfigMap selector if those differ. The yq syntax is Mike Farah v4. Select the live ConfigMap name and namespace separately for the actual control-plane revision.[1][2]

Terminal window
set -o pipefail
KUBE_CONTEXT='<your-context>'
ISTIO_NS='<istio-namespace>'
MESH_CONFIGMAP='<mesh-configmap>'
WORKLOAD_NS='<workload-namespace>'
WORKLOAD_POD='<workload-pod>'
kustomize build example \
| yq 'select(.kind == "ConfigMap" and .metadata.name == "istio" and .metadata.namespace == "istio-system") | .data.mesh | from_yaml | .defaultProviders.metrics'
kubectl --context "$KUBE_CONTEXT" -n "$ISTIO_NS" \
get configmap "$MESH_CONFIGMAP" -o jsonpath='{.data.mesh}' \
| yq '.defaultProviders.metrics'
kubectl --context "$KUBE_CONTEXT" -n "$ISTIO_NS" \
get telemetry.telemetry.istio.io -o yaml
kubectl --context "$KUBE_CONTEXT" -n "$WORKLOAD_NS" \
get telemetry.telemetry.istio.io -o yaml
  • Missing in the render: inspect whether that overlay replaces the base mesh string. This is a source candidate matching the PR’s omission, not proof of the runtime cause.
  • Present in the render but absent live: investigate mismatched revisions, overlays, or ConfigMap targets. This PR alone cannot explain how the live configuration changed.
  • Present in both: do not assume this omission is the cause. If the mesh’s rootNamespace differs from the Istio namespace above, inspect its Telemetry resources too. Check metrics.providers, overrides.disabled, and match.mode in root/workload namespace policies and applicable workload selectors/targetRefs. Having a provider does not guarantee that all request metrics are enabled.[4][5]

First establish that the target Pod has a sidecar and check its control-plane/proxy versions. Distinguish the installation manifest version from running image versions. The syntax below corresponds to the Istio 1.30.2 istioctl source; check the CLI help for other versions, and do not apply it to an ambient Pod without a sidecar.[10]

Terminal window
ISTIOD_DEPLOYMENT='<istiod-deployment>'
kubectl --context "$KUBE_CONTEXT" -n "$ISTIO_NS" \
get deployment "$ISTIOD_DEPLOYMENT" \
-o jsonpath='{range .spec.template.spec.containers[*]}{.name}{" "}{.image}{"\n"}{end}'
kubectl --context "$KUBE_CONTEXT" -n "$WORKLOAD_NS" \
get pod "$WORKLOAD_POD" \
-o jsonpath='{range .spec.initContainers[*]}{.name}{" "}{.image}{"\n"}{end}{range .spec.containers[*]}{.name}{" "}{.image}{"\n"}{end}'
istioctl --context "$KUBE_CONTEXT" -n "$WORKLOAD_NS" \
proxy-config listeners "$WORKLOAD_POD" -o json \
| jq '[.. | objects | select(.name? == "istio.stats") | .name] | unique'
istioctl --context "$KUBE_CONTEXT" experimental envoy-stats \
"$WORKLOAD_POD.$WORKLOAD_NS" --output prom \
| grep -E '^istio_requests_total(\{|[[:space:]])'

The istio.stats search is a supporting clue about a filter name in listeners; the second read checks for the proxy’s current counter. Filter presence proves neither actual requests nor a successful scrape. If a successful read has no counter despite HTTP/gRPC requests, investigate provider/Telemetry overrides, proxy synchronization, and whether traffic traversed this proxy. If the counter exists, continue to the next branch. Distinguish an empty grep result from a failed CLI/API read.[4][10]

Separate Prometheus targets, scraping, and queries

Section titled “Separate Prometheus targets, scraping, and queries”

In the Targets page of the Prometheus instance used by Kiali, inspect target discovery, health, lastError, lastScrape, and the scrape URL for the selected proxy. For API inspection, narrow by target labels as below. The namespace/pod label names depend on scrape configuration; adapt the selector to the actual labels. An empty filtered result does not prove a discovery failure. Also inspect dropped targets and relabel rules for that target.[9]

Terminal window
PROMETHEUS_URL='https://prometheus.example.com'
curl --fail --silent --show-error "$PROMETHEUS_URL/api/v1/targets?state=active" \
| jq --arg ns "$WORKLOAD_NS" --arg pod "$WORKLOAD_POD" \
'.data.activeTargets[] | select(.labels.namespace == $ns and .labels.pod == $pod) | {health, lastError, lastScrape, scrapeUrl}'

Distinguish proxy endpoints from the actual scrape URL. Istio 1.30 metrics merging uses :15020/stats/prometheus, while direct Envoy scraping uses :15090/stats/prometheus. The PR’s enablePrometheusMerge: true does not establish that Prometheus scrapes that endpoint. Check whether collection uses an annotation-based job or separate scrape configuration, then inspect port/path/TLS and metric-relabel drops.[6]

Evaluate these queries in the same Prometheus instance. Label values are placeholders and 5m is an example window; adapt it to the actual scrape interval and observation time.

up{job="<scrape-job>", instance="<target-instance>"}
istio_requests_total{destination_workload_namespace="<workload-namespace>"}
sum by (reporter) (
rate(istio_requests_total{destination_workload_namespace="<workload-namespace>"}[5m])
)
  • Target absent/down: investigate discovery, relabeling, connectivity, or scrape failure first. This is distinct from the health of the Prometheus server itself.
  • Counter exists at the proxy but not in Prometheus: check endpoint selection, metric drops, query labels, and timestamps. Even up == 1 does not guarantee collection of request metrics.
  • Counter exists but rate is zero or empty: distinguish no requests from insufficient samples for rate calculation. Check that reporter and source/destination namespace labels match the actual traffic direction. Counter presence and current request rate are different observations.[7]

If Prometheus has the data but Kiali does not, check display and source

Section titled “If Prometheus has the data but Kiali does not, check display and source”

Reconcile selected namespaces, Duration, Graph Hide/filters, and query time. Request rates require enough scrape samples; an overly short Duration alone is not evidence of failure.[7] Check that Kiali’s external_services.prometheus.url points to the source queried above, that Kiali can reach it, and that authentication/TLS configuration and error notifications are understood. Do not print secret values.[8]

For installations using a Kiali Operator CR, read only the URL field as below. Helm/direct installations may have no such CR; compare only the URL field in the runtime configuration appropriate to the installation method and version. This example changes no settings.[8]

Terminal window
KIALI_NS='<kiali-namespace>'
KIALI_NAME='<kiali-resource>'
kubectl --context "$KUBE_CONTEXT" -n "$KIALI_NS" \
get kiali.kiali.io "$KIALI_NAME" \
-o jsonpath='{.spec.external_services.prometheus.url}'

Passing these branches does not automatically establish graph recovery. Check both the query and Kiali display for the same time and namespace with actual requests, and retain that observation evidence separately from the source diff and merge record.

This was more than just adding back three YAML lines.

Observability is part of installation completeness

Section titled “Observability is part of installation completeness”

Getting Kubeflow installed is not the finish line. In real operations, the system is only truly usable when traffic is visible, request volume is visible, and service relationships are visible. Empty Kiali graphs are not just a cosmetic issue. They mean operators lose a key way to understand system behavior.

Layered patches can quietly erase defaults

Section titled “Layered patches can quietly erase defaults”

With Kustomize and layered patching, the intent may be to tweak one field, but the actual result can be that some existing defaults disappear. Deeply nested config like Istio mesh settings is especially vulnerable to this kind of regression.

That is exactly what happened here. A patch meant for oauth2-proxy and auth behavior also ended up changing observability defaults.

Small OSS fixes are still high-value contributions

Section titled “Small OSS fixes are still high-value contributions”

When people think about open source contributions, they often imagine large features. But in real-world platform work, a small regression fix can have a much more immediate impact on users.

This kind of bug is hard to spot unless you actually install the stack, and hard to explain unless you follow the telemetry path end to end. That is why this type of patch is so practical and valuable.

The most important part of this PR was not writing a lot of code. It was being able to read the symptom downward through the system layers.

  • Kiali graphs are empty
  • Is Prometheus broken?
  • Why are Istio metrics missing?
  • The mesh config lost its default provider
  • That loss came from the oauth2-proxy patch

At the end of that chain, the final fix was only three lines.

The more I do this kind of work, the more open source contribution feels like reproducing the behavior, understanding the structure, and restoring the smallest correct fix. That is especially true in platform and infrastructure layers.

For the same symptom, rather than stopping at Kiali or immediately applying this three-line patch, narrow the evidence in your own environment through actual requests → rendered/live configuration → proxy metrics → Prometheus collection → Kiali display.

The Istio evidence is scoped to the 1.30 documentation and 1.30.2 source. The Kiali and Prometheus API references are current documentation/source retrieved for this enrichment, not evidence of the versions installed at the time. Also compare the schema and CLI help for your actual installation versions.

[1] PR #3532

[2] PR base: Istio install.yaml

[3] Merge commit: oauth2-proxy mesh patch

[4] Istio 1.30.2: telemetry provider selection

[5] Istio 1.30: Telemetry API

[6] Istio 1.30: Prometheus integration

[7] Kiali: graph troubleshooting

[8] Kiali: Prometheus configuration

[9] Prometheus: HTTP API source

[10] Istio 1.30.2: proxy-config CLI source