envoyproxy/envoy

stats: Allow overriding default tag extractors in stats_tags without disabling defaults

Open

#44.373 geöffnet am 10. Apr. 2026

Auf GitHub ansehen
 (7 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (5.373 Forks)batch import
area/adminarea/statsenhancementhelp wanted

Repository-Metriken

Stars
 (27.997 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T) (303 gemergte PRs in 30 T)

Beschreibung

Title: stats: Allow overriding default tag extractors in stats_tags without disabling defaults

Description: Our Envoy cluster names have evolved significantly over time; however, for metric backwards compatibility, our alt_stat_name (which populates the envoy.cluster_name tag) has remained static. This prevents us from adopting richer metric sets because any change to alt_stat_name immediately changes the resulting envoy.cluster_name tag, breaking downstream dashboards.

Current State: To override a default tag like envoy.cluster_name while keeping other defaults, users must currently set use_all_default_tags: false and manually redefine the entire list of built-in extractors under stats_tags. This is error-prone and creates "configuration drift" as users must manually track and maintain Envoy’s internal default regexes indefinitely.

Proposed Change: I propose allowing entries in stats_tags to take precedence over built-in extractors with the same tag name. This would allow users to provide a single override for envoy.cluster_name while still benefiting from the rest of the default tag suite provided by Envoy.

To maintain backwards compatibility, this behavior could be enabled via a new boolean field in StatsConfig (e.g., allow_default_tag_overrides) or by defining a specific merge strategy for the stats_tags list.

Contribution: I am willing to implement this feature if the maintainers agree with the direction.

[optional Relevant Links:] https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/metrics/v3/stats.proto

Contributor Guide