istio: Envoy stat monitor duplicated metrics - part II
Is this the right place to submit this?
- This is not a security vulnerability or a crashing bug
- This is not a question about how to use Istio
Bug Description
Using Prometheus: 2.52.0
Running Istio in a K8s cluster with metric merging.
We find intermittent issues scrapping metrics in some of the pods in the istio mesh.
[pod/prometheus-prometheus-kube-prometheus-prometheus-2/prometheus] 2025-02-03T16:47:03.980211264Z ts=2025-02-03T16:47:03.980Z caller=scrape.go:1738 level=warn component="scrape manager" scrape_pool=podMonitor/monitoring/envoy-stats/0 target=http://100.116.73.204:15020/stats/prometheus msg="Error on ingesting samples with different value but same timestamp" num_dropped=4
Sometimes all of the pods in a given deployment will suddenly start exhibiting this issue after having been running without issues for hours. In other cases only a single pod of a deployment will start showing this behavior.
Deeper investigation as led to 4 specific istio metrics being at fault.
istio_tcp_connections_closed_total
istio_tcp_connections_opened_total
istio_tcp_received_bytes_total
istio_tcp_sent_bytes_total
These metrics are being exposed with duplicate labels and a different value during the scrapes which leads Prometheus to complain about the same timestamp.
"curl http://100.117.80.12:15020/stats/prometheus" | grep -E "(istio_tcp_connections_closed_total|istio_tcp_connections_opened_total|istio_tcp_received_bytes_total|istio_tcp_sent_bytes_total)" | grep -v "^#" | grep "istio_tcp_received_bytes_total"
istio_tcp_received_bytes_total{reporter="source",source_workload="cid-sync-soap-routing-service",source_canonical_service="cid-sync-soap-routing-service",source_canonical_revision="1.16.0",source_workload_namespace="if-corp-sync",source_principal="spiffe://cluster.local/ns/if-corp-sync/sa/cid-sync-soap-routing-service",source_app="",source_version="",source_cluster="Kubernetes",destination_workload="rabbitmq-core-server",destination_workload_namespace="rabbitmq-server",destination_principal="spiffe://cluster.local/ns/rabbitmq-server/sa/rabbitmq-core-server",destination_app="unknown",destination_version="unknown",destination_service="rabbitmq-core.rabbitmq-server.svc.cluster.local",destination_canonical_service="rabbitmq-core",destination_canonical_revision="latest",destination_service_name="rabbitmq-core",destination_service_namespace="rabbitmq-server",destination_cluster="Kubernetes",request_protocol="tcp",response_flags="-",connection_security_policy="unknown"} 480082
istio_tcp_received_bytes_total{reporter="source",source_workload="cid-sync-soap-routing-service",source_canonical_service="cid-sync-soap-routing-service",source_canonical_revision="1.16.0",source_workload_namespace="if-corp-sync",source_principal="spiffe://cluster.local/ns/if-corp-sync/sa/cid-sync-soap-routing-service",source_app="",source_version="",source_cluster="Kubernetes",destination_workload="rabbitmq-core-server",destination_workload_namespace="rabbitmq-server",destination_principal="spiffe://cluster.local/ns/rabbitmq-server/sa/rabbitmq-core-server",destination_app="unknown",destination_version="unknown",destination_service="rabbitmq-core.rabbitmq-server.svc.cluster.local",destination_canonical_service="rabbitmq-core",destination_canonical_revision="latest",destination_service_name="rabbitmq-core",destination_service_namespace="rabbitmq-server",destination_cluster="Kubernetes",request_protocol="tcp",response_flags="-",connection_security_policy="unknown"} 8
istio_tcp_received_bytes_total{reporter="source",source_workload="cid-sync-soap-routing-service",source_canonical_service="cid-sync-soap-routing-service",source_canonical_revision="1.16.0",source_workload_namespace="if-corp-sync",source_principal="unknown",source_app="",source_version="",source_cluster="Kubernetes",destination_workload="unknown",destination_workload_namespace="unknown",destination_principal="unknown",destination_app="unknown",destination_version="unknown",destination_service="unknown",destination_canonical_service="unknown",destination_canonical_revision="latest",destination_service_name="BlackHoleCluster",destination_service_namespace="unknown",destination_cluster="unknown",request_protocol="tcp",response_flags="UH",connection_security_policy="unknown"} 0
This bug is the second part of #52221
Version
$ istioctl version
client version: 1.24.2
control plane version: 1.24.1
data plane version: 1.24.1 (72 proxies)
$ kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.27.7
Kustomize Version: v5.0.1
Server Version: v1.30.8-eks-2d5f260
Additional Information
No response
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 9
- Comments: 22 (5 by maintainers)
@kyessenov can you take a look at this?