@@ -44,12 +44,12 @@ type PolicyType string
4444const (
4545 // AlwaysSample samples all traces, typically used for debugging.
4646 AlwaysSample PolicyType = "always-sample"
47- // NumericTagFilter sample traces that have a given numberic tag in a specified
48- // range, e.g.: tag "http.status_code" >= 399 and <= 999.
49- NumericTagFilter PolicyType = "numeric-tag -filter"
50- // StringTagFilter sample traces that a tag , of type string, matching
47+ // NumericAttributeFilter sample traces that have a given numeric attribute in a specified
48+ // range, e.g.: attribute "http.status_code" >= 399 and <= 999.
49+ NumericAttributeFilter PolicyType = "numeric-attribute -filter"
50+ // StringAttributeFilter sample traces that a attribute , of type string, matching
5151 // one of the listed values.
52- StringTagFilter PolicyType = "string-tag -filter"
52+ StringAttributeFilter PolicyType = "string-attribute -filter"
5353 // RateLimiting allows all traces until the specified limits are satisfied.
5454 RateLimiting PolicyType = "rate-limiting"
5555)
@@ -67,27 +67,27 @@ type PolicyCfg struct {
6767 Configuration interface {}
6868}
6969
70- // NumericTagFilterCfg holds the configurable settings to create a numeric tag filter
70+ // NumericAttributeFilterCfg holds the configurable settings to create a numeric attribute filter
7171// sampling policy evaluator.
72- type NumericTagFilterCfg struct {
72+ type NumericAttributeFilterCfg struct {
7373 // Tag that the filter is going to be matching against.
74- Tag string `mapstructure:"tag "`
75- // MinValue is the minimum value of the tag to be considered a match.
74+ Key string `mapstructure:"key "`
75+ // MinValue is the minimum value of the attribute to be considered a match.
7676 MinValue int64 `mapstructure:"min-value"`
77- // MaxValue is the maximum value of the tag to be considered a match.
77+ // MaxValue is the maximum value of the attribute to be considered a match.
7878 MaxValue int64 `mapstructure:"max-value"`
7979}
8080
81- // StringTagFilterCfg holds the configurable settings to create a string tag filter
81+ // StringAttributeFilterCfg holds the configurable settings to create a string attribute filter
8282// sampling policy evaluator.
83- type StringTagFilterCfg struct {
83+ type StringAttributeFilterCfg struct {
8484 // Tag that the filter is going to be matching against.
85- Tag string `mapstructure:"tag "`
86- // Values is the set of tag values that if any is equal to the actual tag valueto be considered a match.
85+ Key string `mapstructure:"key "`
86+ // Values is the set of attribute values that if any is equal to the actual attribute value to be considered a match.
8787 Values []string `mapstructure:"values"`
8888}
8989
90- // RateLimitingCfg holds the configurable settings to create a string tag filter
90+ // RateLimitingCfg holds the configurable settings to create a string attribute filter
9191// sampling policy evaluator.
9292type RateLimitingCfg struct {
9393 // SpansPerSecond limit to the number of spans per second
@@ -135,12 +135,12 @@ func (sCfg *SamplingCfg) InitFromViper(v *viper.Viper) *SamplingCfg {
135135 // As the number of polices grow this likely should be in a map.
136136 var cfg interface {}
137137 switch polCfg .Type {
138- case NumericTagFilter :
139- numTagFilterCfg := & NumericTagFilterCfg {}
140- cfg = numTagFilterCfg
141- case StringTagFilter :
142- strTagFilterCfg := & StringTagFilterCfg {}
143- cfg = strTagFilterCfg
138+ case NumericAttributeFilter :
139+ numAttributeFilterCfg := & NumericAttributeFilterCfg {}
140+ cfg = numAttributeFilterCfg
141+ case StringAttributeFilter :
142+ strAttributeFilterCfg := & StringAttributeFilterCfg {}
143+ cfg = strAttributeFilterCfg
144144 case RateLimiting :
145145 rateLimitingCfg := & RateLimitingCfg {}
146146 cfg = rateLimitingCfg
0 commit comments