From 9e0602b523addc2129568f3ebedf27d96013d458 Mon Sep 17 00:00:00 2001 From: "data-plane-api(Azure Pipelines)" Date: Thu, 6 Apr 2023 14:36:16 +0000 Subject: [PATCH] metrics service: allow only histogram summaries (#25812) Commit Message: Allow only histogram summaries in metric service Additional Description: Histogram metrics by default send two metrics Summary (containing quantiles) and Histogram (containing all the buckets), this makes payloads extremely large when handling lots of stats. In some cases, only having the summary is enough, since we can get sum, count, and percentiles. Furthermore, it probably only makes sense to send one of both, if I were to need buckets, then Summary is probably useless. Risk Level: low, off by default Testing: Docs Changes: Release Notes: Platform Specific Features: Signed-off-by: Sebastian Schepens Mirrored from https://github.com/envoyproxy/envoy @ c40aca4c1b51f2089fd33e70b393041c6b291064 --- envoy/config/metrics/v3/metrics_service.proto | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/envoy/config/metrics/v3/metrics_service.proto b/envoy/config/metrics/v3/metrics_service.proto index 9998f894..7ef69336 100644 --- a/envoy/config/metrics/v3/metrics_service.proto +++ b/envoy/config/metrics/v3/metrics_service.proto @@ -19,6 +19,18 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: Metrics service] +// HistogramEmitMode is used to configure which metric types should be emitted for histograms. +enum HistogramEmitMode { + // Emit Histogram and Summary metric types. + SUMMARY_AND_HISTOGRAM = 0; + + // Emit only Summary metric types. + SUMMARY = 1; + + // Emit only Histogram metric types. + HISTOGRAM = 2; +} + // Metrics Service is configured as a built-in ``envoy.stat_sinks.metrics_service`` :ref:`StatsSink // `. This opaque configuration will be used to create // Metrics Service. @@ -34,6 +46,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // transport_api_version: V3 // // [#extension: envoy.stat_sinks.metrics_service] +// [#next-free-field: 6] message MetricsServiceConfig { option (udpa.annotations.versioning).previous_message_type = "envoy.config.metrics.v2.MetricsServiceConfig"; @@ -55,4 +68,7 @@ message MetricsServiceConfig { // and the tag extracted name will be used instead of the full name, which may contain values used by the tag // extractor or additional tags added during stats creation. bool emit_tags_as_labels = 4; + + // Specify which metrics types to emit for histograms. Defaults to SUMMARY_AND_HISTOGRAM. + HistogramEmitMode histogram_emit_mode = 5 [(validate.rules).enum = {defined_only: true}]; }