envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.27k stars 4.69k forks source link

Can Envoy aggregate counter of sub-clusters to that under parent cluster #34446

Open RogerYYYY opened 1 month ago

RogerYYYY commented 1 month ago

I have configured two clusters external-egress-tls for TLS connections -- IP is destinationIP1 external-egress for non-TLS connections -- IP is destinationIP2

the sub-cluster mode is applied for both clusters for DNS query.

  - name: external-egress-tls
    cluster_type:
      name: envoy.clusters.dynamic_forward_proxy
      typed_config:
        "@type": type.googleapis.com/envoy.extensions.clusters.dynamic_forward_proxy.v3.ClusterConfig
        sub_clusters_config:
          lb_policy: ROUND_ROBIN

  - name: external-egress
    cluster_type:
      name: envoy.clusters.dynamic_forward_proxy
      typed_config:
        "@type": type.googleapis.com/envoy.extensions.clusters.dynamic_forward_proxy.v3.ClusterConfig
        sub_clusters_config:
          lb_policy: ROUND_ROBIN

After running some HTTP requests, only sub-cluster counters are incremented.

curl http://envoy_IP_PORT/stats?filter=cluster.*.upstream_rq_total cluster.DFPCluster_destinationIP1_8081.upstream_rq_total: 1 cluster.DFPCluster_destinationIP2_8082.upstream_rq_total: 1 cluster.DFPCluster_destinationIP2_8083.upstream_rq_total: 1 cluster.external-egress-tls.upstream_rq_total: 0 cluster.external-egress.upstream_rq_total: 0

Application can't get accurate TLS/NonTLS statistics from such output.

We hope sub-cluster counters can be aggregated to parent cluster cluster.external-egress-tls and cluster.external-egress. Is there configuration way to realize this?

github-actions[bot] commented 4 days ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.