stats: Add additional constraints to histogram bucket configuration (#12312)

This ensures that the configuration is valid.

Note that this adds stricter validation to an existing proto field, but the field was only added 5 days ago, so only someone running HEAD, using this new config, with invalid/non-sensical config should be affected.

Signed-off-by: Greg Greenway <ggreenway@apple.com>

Mirrored from https://github.com/envoyproxy/envoy @ 61c2816f704d11f66a507b76abc8f01c1816fe57
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent 91a7b929b2
commit 73c0b060be
  1. 9
      envoy/config/metrics/v3/stats.proto
  2. 9
      envoy/config/metrics/v4alpha/stats.proto

@ -294,8 +294,13 @@ message HistogramBucketSettings {
// before tag-extraction, for example `cluster.exampleclustername.upstream_cx_length_ms`.
type.matcher.v3.StringMatcher match = 1 [(validate.rules).message = {required: true}];
// Each value is the upper bound of a successive bucket.
repeated double buckets = 2 [(validate.rules).repeated = {min_items: 1}];
// Each value is the upper bound of a bucket. Each bucket must be greater than 0 and unique.
// The order of the buckets does not matter.
repeated double buckets = 2 [(validate.rules).repeated = {
min_items: 1
unique: true
items {double {gt: 0.0}}
}];
}
// Stats configuration proto schema for built-in *envoy.stat_sinks.statsd* sink. This sink does not support

@ -297,8 +297,13 @@ message HistogramBucketSettings {
// before tag-extraction, for example `cluster.exampleclustername.upstream_cx_length_ms`.
type.matcher.v4alpha.StringMatcher match = 1 [(validate.rules).message = {required: true}];
// Each value is the upper bound of a successive bucket.
repeated double buckets = 2 [(validate.rules).repeated = {min_items: 1}];
// Each value is the upper bound of a bucket. Each bucket must be greater than 0 and unique.
// The order of the buckets does not matter.
repeated double buckets = 2 [(validate.rules).repeated = {
min_items: 1
unique: true
items {double {gt: 0.0}}
}];
}
// Stats configuration proto schema for built-in *envoy.stat_sinks.statsd* sink. This sink does not support

Loading…
Cancel
Save