Skip to content

Commit

Permalink
Change prometheus metrics type from summary to histogram
Browse files Browse the repository at this point in the history
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.

Fixes antrea-io#905
  • Loading branch information
Yongming Ding committed Sep 11, 2020
1 parent 973e479 commit 9f64d5c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/controller/metrics/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9f64d5c

Please sign in to comment.