Skip to content

stats: allow tag overrides for default envoy tags#45528

Open
fritojay wants to merge 1 commit into
envoyproxy:mainfrom
fritojay:allow-default-tag-override
Open

stats: allow tag overrides for default envoy tags#45528
fritojay wants to merge 1 commit into
envoyproxy:mainfrom
fritojay:allow-default-tag-override

Conversation

@fritojay

@fritojay fritojay commented Jun 9, 2026

Copy link
Copy Markdown

Commit Message:

This feature was written with AI assistance.

Add an opt-in allow_default_tag_overrides field to StatsConfig. When
set to true, a custom extractor declared in stats_tags takes
precedence over the built-in default tag extractor that shares the same
tag_name, instead of the default winning. This makes it possible to
override an individual default Envoy tag (for example
envoy.cluster_name) while keeping use_all_default_tags enabled,
without having to disable all defaults and re-declare every extractor.

Only specifiers that actually supply an extractor participate in
overriding (a non-empty regex or a fixed_value); a specifier with an
empty regex keeps its existing meaning of re-enabling the default. The
field has no effect when use_all_default_tags is false, and defaults to
false to preserve existing behavior.

Signed-off-by: Jay Ostinowsky jayo@indeed.com

Additional Description:

Use case: Allows users to override default stats tags without having to disable all default tags and re-enumerating them in their own envoy configuration. This is particularly helpful for allowing users to evolve metric tags over time with additional tags and extractors, while also not changing envoy defaults for backwards compatibility.

Example configuration:

stats_config:
  allow_default_tag_overrides: true
  stats_tags:
  - tag_name: "envoy.cluster_name"
      regex: "^cluster(\\.servicename__([^_.]+(?:_[^_.]+)*))"

Risk Level: Low
Testing: Added unit tests to cover the override functionality.
Docs Changes: updated the documentation to include the new property and describe what the property does.
Release Notes: added the changelog file that describes the feature.
Platform Specific Features: N/A
Fixes #44373

This feature was written with AI assistance.

Add an opt-in `allow_default_tag_overrides` field to StatsConfig. When
set to true, a custom extractor declared in `stats_tags` takes
precedence over the built-in default tag extractor that shares the same
`tag_name`, instead of the default winning. This makes it possible to
override an individual default Envoy tag (for example
`envoy.cluster_name`) while keeping `use_all_default_tags` enabled,
without having to disable all defaults and re-declare every extractor.

Only specifiers that actually supply an extractor participate in
overriding (a non-empty `regex` or a `fixed_value`); a specifier with an
empty regex keeps its existing meaning of re-enabling the default. The
field has no effect when `use_all_default_tags` is false, and defaults to
false to preserve existing behavior.

Signed-off-by: Jay Ostinowsky <jayo@indeed.com>
@repokitteh-read-only

Copy link
Copy Markdown

Hi @fritojay, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #45528 was opened by fritojay.

see: more, trace.

@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #45528 was opened by fritojay.

see: more, trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants