Stats¶
This documentation is for the Envoy v3 API.
As of Envoy v1.18 the v2 API has been removed and is no longer supported.
If you are upgrading from v2 API config you may wish to view the v2 API documentation:
Statistics architecture overview.
config.metrics.v3.StatsSink¶
[config.metrics.v3.StatsSink proto]
Configuration for pluggable stats sinks.
{
"name": "...",
"typed_config": "{...}"
}
- name
(string) The name of the stats sink to instantiate. The name must match a supported stats sink. See the extensions listed in typed_config below for the default list of available stats sink. Sinks optionally support tagged/multiple dimensional metrics.
- typed_config
(Any) Stats sink specific configuration which depends on the sink being instantiated. See StatsdSink for an example.
Tip
This extension category has the following known extensions:
config.metrics.v3.StatsConfig¶
[config.metrics.v3.StatsConfig proto]
Statistics configuration such as tagging.
{
"stats_tags": [],
"use_all_default_tags": "{...}",
"stats_matcher": "{...}",
"histogram_bucket_settings": []
}
- stats_tags
(repeated config.metrics.v3.TagSpecifier) Each stat name is iteratively processed through these tag specifiers. When a tag is matched, the first capture group is removed from the name so later TagSpecifiers cannot match that same portion of the match.
- stats_matcher
(config.metrics.v3.StatsMatcher) Inclusion/exclusion matcher for stat name creation. If not provided, all stats are instantiated as normal. Preventing the instantiation of certain families of stats can improve memory performance for Envoys running especially large configs.
Warning
Excluding stats may affect Envoy’s behavior in undocumented ways. See issue #8771 for more information. If any unexpected behavior changes are observed, please open a new issue immediately.
- histogram_bucket_settings
(repeated config.metrics.v3.HistogramBucketSettings) Defines rules for setting the histogram buckets. Rules are evaluated in order, and the first match is applied. If no match is found (or if no rules are set), the following default buckets are used:
[ 0.5, 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 30000, 60000, 300000, 600000, 1800000, 3600000 ]
config.metrics.v3.StatsMatcher¶
[config.metrics.v3.StatsMatcher proto]
Configuration for disabling stat instantiation.
{
"reject_all": "...",
"exclusion_list": "{...}",
"inclusion_list": "{...}"
}
- reject_all
(bool) If reject_all is true, then all stats are disabled. If reject_all is false, then all stats are enabled.
Precisely one of reject_all, exclusion_list, inclusion_list must be set.
- exclusion_list
(type.matcher.v3.ListStringMatcher) Exclusive match. All stats are enabled except for those matching one of the supplied StringMatcher protos.
Precisely one of reject_all, exclusion_list, inclusion_list must be set.
- inclusion_list
(type.matcher.v3.ListStringMatcher) Inclusive match. No stats are enabled except for those matching one of the supplied StringMatcher protos.
Precisely one of reject_all, exclusion_list, inclusion_list must be set.
config.metrics.v3.TagSpecifier¶
[config.metrics.v3.TagSpecifier proto]
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.
{
"tag_name": "...",
"regex": "...",
"fixed_value": "..."
}
config.metrics.v3.HistogramBucketSettings¶
[config.metrics.v3.HistogramBucketSettings proto]
Specifies a matcher for stats and the buckets that matching stats should use.
{
"match": "{...}",
"buckets": []
}
- match
(type.matcher.v3.StringMatcher, REQUIRED) The stats that this rule applies to. The match is applied to the original stat name before tag-extraction, for example cluster.exampleclustername.upstream_cx_length_ms.
- buckets
(repeated double, REQUIRED) 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.
config.metrics.v3.StatsdSink¶
[config.metrics.v3.StatsdSink proto]
Stats configuration proto schema for built-in envoy.stat_sinks.statsd sink. This sink does not support tagged metrics.
This extension may be referenced by the qualified name envoy.stat_sinks.statsd
Note
This extension does not operate on the data plane and hence is intended to be robust against untrusted traffic.
{
"address": "{...}",
"tcp_cluster_name": "...",
"prefix": "..."
}
- address
(config.core.v3.Address) The UDP address of a running statsd compliant listener. If specified, statistics will be flushed to this address.
Precisely one of address, tcp_cluster_name must be set.
- tcp_cluster_name
(string) The name of a cluster that is running a TCP statsd compliant listener. If specified, Envoy will connect to this cluster to flush statistics.
Precisely one of address, tcp_cluster_name must be set.
- prefix
(string) Optional custom prefix for StatsdSink. If specified, this will override the default prefix. For example:
{ "prefix" : "envoy-prod" }
will change emitted stats to
envoy-prod.test_counter:1|c envoy-prod.test_timer:5|ms
Note that the default prefix, “envoy”, will be used if a prefix is not specified.
Stats with default prefix:
envoy.test_counter:1|c envoy.test_timer:5|ms
config.metrics.v3.DogStatsdSink¶
[config.metrics.v3.DogStatsdSink proto]
Stats configuration proto schema for built-in envoy.stat_sinks.dog_statsd sink. The sink emits stats with DogStatsD compatible tags. Tags are configurable via StatsConfig.
This extension may be referenced by the qualified name envoy.stat_sinks.dog_statsd
Note
This extension does not operate on the data plane and hence is intended to be robust against untrusted traffic.
{
"address": "{...}",
"prefix": "...",
"max_bytes_per_datagram": "{...}"
}
- address
(config.core.v3.Address, REQUIRED) The UDP address of a running DogStatsD compliant listener. If specified, statistics will be flushed to this address.
- prefix
(string) Optional custom metric name prefix. See StatsdSink’s prefix field for more details.
- max_bytes_per_datagram
(UInt64Value) Optional max datagram size to use when sending UDP messages. By default Envoy will emit one metric per datagram. By specifying a max-size larger than a single metric, Envoy will emit multiple, new-line separated metrics. The max datagram size should not exceed your network’s MTU.
Note that this value may not be respected if smaller than a single metric.
config.metrics.v3.HystrixSink¶
[config.metrics.v3.HystrixSink proto]
Stats configuration proto schema for built-in envoy.stat_sinks.hystrix sink. The sink emits stats in text/event-stream formatted stream for use by Hystrix dashboard.
Note that only a single HystrixSink should be configured.
Streaming is started through an admin endpoint GET /hystrix_event_stream
.
This extension may be referenced by the qualified name envoy.stat_sinks.hystrix
Note
This extension does not operate on the data plane and hence is intended to be robust against untrusted traffic.
{
"num_buckets": "..."
}
- num_buckets
(int64) The number of buckets the rolling statistical window is divided into.
Each time the sink is flushed, all relevant Envoy statistics are sampled and added to the rolling window (removing the oldest samples in the window in the process). The sink then outputs the aggregate statistics across the current rolling window to the event stream(s).
rolling_window(ms) = stats_flush_interval(ms) * num_of_buckets
More detailed explanation can be found in Hystrix wiki.