-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add prometheus metrics for antrea controller
This CL brings metrics of antrea controller events processing, includes: syncing time, processed number, and queue length. Signed-off-by: Weiqiang TANG <weiqiangt@vmware.com>
- Loading branch information
Showing
3 changed files
with
107 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Copyright 2020 Antrea Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Package metrics provides metrics declaration for the antrea controller. | ||
|
||
package metrics | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
) | ||
|
||
var ( | ||
OpsAppliedToGroupProcessed = promauto.NewCounter(prometheus.CounterOpts{ | ||
Name: "applied_to_group_processed", | ||
Help: "The total number of applied-to-group processed", | ||
}) | ||
OpsAddressGroupProcessed = promauto.NewCounter(prometheus.CounterOpts{ | ||
Name: "address_group_processed", | ||
Help: "The total number of address-group processed ", | ||
}) | ||
OpsInternalNetworkPolicyProcessed = promauto.NewCounter(prometheus.CounterOpts{ | ||
Name: "network_policy_processed", | ||
Help: "The total number of internal-networkpolicy processed", | ||
}) | ||
DurationAppliedToGroupProcessing = promauto.NewSummary(prometheus.SummaryOpts{ | ||
Name: "applied_to_group_process_duration_milliseconds", | ||
Help: "The duration of processing applied-to groups", | ||
}) | ||
DurationAddressGroupProcessing = promauto.NewSummary(prometheus.SummaryOpts{ | ||
Name: "address_group_process_duration_milliseconds", | ||
Help: "The duration of processing address-group", | ||
}) | ||
DurationInternalNetworkPolicyProcessing = promauto.NewSummary(prometheus.SummaryOpts{ | ||
Name: "network_policy_process_duration_milliseconds", | ||
Help: "The duration of processing internal-networkpolicy", | ||
}) | ||
DurationAppliedToGroupSyncing = promauto.NewSummary(prometheus.SummaryOpts{ | ||
Name: "applied_to_group_sync_duration_milliseconds", | ||
Help: "The duration of syncing applied-to-group", | ||
}) | ||
DurationAddressGroupSyncing = promauto.NewSummary(prometheus.SummaryOpts{ | ||
Name: "address_group_sync_duration_milliseconds", | ||
Help: "The duration of syncing address-group", | ||
}) | ||
DurationInternalNetworkPolicySyncing = promauto.NewSummary(prometheus.SummaryOpts{ | ||
Name: "network_policy_sync_duration_milliseconds", | ||
Help: "The duration of syncing internal-networkpolicy", | ||
}) | ||
LengthAppliedToGroupQueue = promauto.NewGauge(prometheus.GaugeOpts{ | ||
Name: "length_applied_to_group_queue", | ||
Help: "The length of AppliedToGroupQueue", | ||
}) | ||
LengthAddressGroupQueue = promauto.NewGauge(prometheus.GaugeOpts{ | ||
Name: "length_address_group_queue", | ||
Help: "The length of AddressGroupQueue", | ||
}) | ||
LengthInternalNetworkPolicyQueue = promauto.NewGauge(prometheus.GaugeOpts{ | ||
Name: "length_network_policy_queue", | ||
Help: "The length of InternalNetworkPolicyQueue", | ||
}) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters