stats: allow tag overrides for default envoy tags#45528
Open
fritojay wants to merge 1 commit into
Open
Conversation
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>
|
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. |
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message:
This feature was written with AI assistance.
Add an opt-in
allow_default_tag_overridesfield to StatsConfig. Whenset to true, a custom extractor declared in
stats_tagstakesprecedence over the built-in default tag extractor that shares the same
tag_name, instead of the default winning. This makes it possible tooverride an individual default Envoy tag (for example
envoy.cluster_name) while keepinguse_all_default_tagsenabled,without having to disable all defaults and re-declare every extractor.
Only specifiers that actually supply an extractor participate in
overriding (a non-empty
regexor afixed_value); a specifier with anempty regex keeps its existing meaning of re-enabling the default. The
field has no effect when
use_all_default_tagsis false, and defaults tofalse 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:
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