Repository navigation
stats: support default tags with fixed value - #416
Conversation
Adding extra fields to TagSpecifier to allow users set default tags which have a fixed value. Signed-off-by: Taiki Ono <[email protected]>
|
|
||
| // Add a default tag which have a fixed value and they will be added to all stats. | ||
| // Typical use case is identifying Envoy instances with the tag. | ||
| string fixed_value = 3; |
There was a problem hiding this comment.
Just use value should be fine.
There was a problem hiding this comment.
I think the notation like "fixed" helps users to distinguish this field from the regex field because this field is placed on the same level as regexp is on. In addition, since this field is in the TagSpecifier message not Tag message, indicating the characteristic of this field would help. WDYT?
| // .. note:: | ||
| // | ||
| // If any default tags are specified twice, the config will be considered | ||
| // If any tag names are specified twice, the config will be considered |
There was a problem hiding this comment.
The comment can be simplified as
// It is invalid to specify the same tag name twice in a config.
| string regex = 2; | ||
|
|
||
| // Add a default tag which have a fixed value and they will be added to all stats. | ||
| // Typical use case is identifying Envoy instances with the tag. |
There was a problem hiding this comment.
The comment can be simplified as.
// Specifies a default tag value for the tag_name.
We don't need to care how the value is used, which can be controlled or stripped in different places.
There was a problem hiding this comment.
Just to add to that, can we remove the term default from the language since that implies it's a fallback value? I think fixed, as you used below, is clearer.
There was a problem hiding this comment.
Agreed. Simplified the description and removed the term. Also I will remove the default term from Envoy side documents. ff78ff3
| // group is provided, the first will also be used to set the value of the tag. | ||
| // All other capture groups will be ignored. | ||
| // | ||
| // Take for example, with a stat name ``cluster.foo_cluster.upstream_rq_timeout`` |
There was a problem hiding this comment.
How about format like this:
Example 1: xxx
description
code
There was a problem hiding this comment.
+1. The structured example format will help readers.
I think the code is placed there as a example condition description, we need to keep the code above the description. So changed like 8631e4f.
| // tag value for all statistics. This will only occur if any part of the name | ||
| // matches the regex provided with one or more capture groups. | ||
| // Configuration for tagged metrics. Setting default tags which have fixed tag | ||
| // value and will be added to all metrics. Or settting dynamic tag extractions |
There was a problem hiding this comment.
Here's how I would reword for maximum clarity:
Designates a tag name and value pair. The value may be either a fixed value or a regex providing the value via capture groups. The specified tag will be unconditionally set if a fixed value, otherwise it will only be set if one or more capture groups in the regex match.
| string regex = 2; | ||
|
|
||
| // Add a default tag which have a fixed value and they will be added to all stats. | ||
| // Typical use case is identifying Envoy instances with the tag. |
There was a problem hiding this comment.
Just to add to that, can we remove the term default from the language since that implies it's a fallback value? I think fixed, as you used below, is clearer.
| // <envoy_api_field_TagSpecifier.tag_name>` is provided in the config with an | ||
| // empty regex, Envoy will attempt to find that name in its set of defaults | ||
| // and use the accompanying regex. | ||
| // <envoy_api_field_TagSpecifier.tag_name>` is provided in the config and none of |
| // empty regex, Envoy will attempt to find that name in its set of defaults | ||
| // and use the accompanying regex. | ||
| // <envoy_api_field_TagSpecifier.tag_name>` is provided in the config and none of | ||
| // :ref:`regex <envoy_api_field_TagSpecifier.regex>` and |
| // tag value for all statistics. This will only occur if any part of the name | ||
| // matches the regex provided with one or more capture groups. | ||
| // Configuration for tagged metrics. Setting default tags which have fixed tag | ||
| // value and will be added to all metrics. Or settting dynamic tag extractions |
Signed-off-by: Taiki Ono <[email protected]>
Signed-off-by: Taiki Ono <[email protected]>
Signed-off-by: Taiki Ono <[email protected]>
Signed-off-by: Taiki Ono <[email protected]>
Signed-off-by: Taiki Ono <[email protected]>
Signed-off-by: Taiki Ono <[email protected]>
Signed-off-by: Taiki Ono <[email protected]>
Signed-off-by: Taiki Ono <[email protected]>
5f93dc4 to
7cba656
Compare
For envoyproxy/envoy#1975.
Adding extra fields to TagSpecifier to allow users set default tags
which have a fixed value.
Envoy side PR: envoyproxy/envoy#2357.