Skip to content

stats_tags - Allow fixed_value in TagSpecifier with regex to select metrics #10751

@murray-stripe

Description

@murray-stripe

Title: Support static tag-values, using a regex to match metrics in which it applies

Description:

I have a deployment in which I need to apply a fixed tag-value to a sub-set of Envoy metrics. The existing support for tagging metrics via StatsConfig.stats_tags is very close to what I need and I am curious if the Envoy project would consider expanding functionality here.

Specifically I would like to provide a configuration such as:

"status_config": {
    "stats_tags": [
        {
            "tag_name": "some_foo",
            "fixed_value_filtered": {
                "value": "some_foo_value",
                "match_regex": "^cluster"
            }
        },
        {
            "tag_name": "some_bar",
            "fixed_value_filtered": {
                "value": "some_bar_value",
                "match_regex": "^http"
            }
        }
    ]
}

This would provide the tag some_foo=some_foo_value to all cluster* metrics and some_var=some_bar_value to all http* metrics.

Alternatively, the match_regex list could be inclusion_list with a type of type.matcher.v3.ListStringMatcher.

I imagine that this could be an additional option added to the oneof tag_value fields in order to avoid breaking backwards compatibility.

Thoughts? Also, if this is something that the envoy team is okay with, I can dedicate my time to putting together a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/statsenhancementFeature requests. Not bugs or questions.stalestalebot believes this issue/PR has not been touched recently

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions