From 237c9210c2e158669d1327cca944747315063b85 Mon Sep 17 00:00:00 2001 From: Yongming Ding Date: Wed, 2 Sep 2020 10:38:39 -0700 Subject: [PATCH] Change prometheus metrics type from summary to histogram Resolves issue: #905 The summary types are tagged for deprecation, Kubernetes recommended to use histograms instead of summaries. The main advantages of histogram types are aggregation and inexpensive. In this commit, we changed three Antrea controller metrics from summary to histogram type. They are DurationAppliedToGroupSyncing, DurationAddressGroupSyncing, and DurationInternalNetworkPolicySyncing. --- pkg/controller/metrics/prometheus.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/controller/metrics/prometheus.go b/pkg/controller/metrics/prometheus.go index 296a59fa69e..1dffa93991c 100644 --- a/pkg/controller/metrics/prometheus.go +++ b/pkg/controller/metrics/prometheus.go @@ -38,20 +38,20 @@ var ( Help: "The total number of internal-networkpolicy processed", StabilityLevel: metrics.STABLE, }) - DurationAppliedToGroupSyncing = metrics.NewSummary(&metrics.SummaryOpts{ + DurationAppliedToGroupSyncing = metrics.NewHistogram(&metrics.HistogramOpts{ Name: "antrea_controller_applied_to_group_sync_duration_milliseconds", Help: "The duration of syncing applied-to-group", - StabilityLevel: metrics.STABLE, + StabilityLevel: metrics.ALPHA, }) - DurationAddressGroupSyncing = metrics.NewSummary(&metrics.SummaryOpts{ + DurationAddressGroupSyncing = metrics.NewHistogram(&metrics.HistogramOpts{ Name: "antrea_controller_address_group_sync_duration_milliseconds", Help: "The duration of syncing address-group", - StabilityLevel: metrics.STABLE, + StabilityLevel: metrics.ALPHA, }) - DurationInternalNetworkPolicySyncing = metrics.NewSummary(&metrics.SummaryOpts{ + DurationInternalNetworkPolicySyncing = metrics.NewHistogram(&metrics.HistogramOpts{ Name: "antrea_controller_network_policy_sync_duration_milliseconds", Help: "The duration of syncing internal-networkpolicy", - StabilityLevel: metrics.STABLE, + StabilityLevel: metrics.ALPHA, }) LengthAppliedToGroupQueue = metrics.NewGauge(&metrics.GaugeOpts{ Name: "antrea_controller_length_applied_to_group_queue",