Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete deprecated Prometheus metrics #1503

Merged
merged 1 commit into from
Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions docs/prometheus-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ errors, partitioned by operation type (add, modify and delete).
flow operations, partitioned by operation type (add, modify and delete).
- **antrea_agent_ovs_total_flow_count:** Total flow count of all OVS flow
tables.
- **antrea_agent_runtime_info:** Antrea agent runtime info (Deprecated since
Antrea 0.10.0), defined as labels. The value of the gauge is always set to 1.

## Antrea Controller Metrics
- **antrea_controller_address_group_processed:** The total number of
Expand All @@ -175,9 +173,6 @@ InternalNetworkPolicyQueue
internal-networkpolicy processed
- **antrea_controller_network_policy_sync_duration_milliseconds:** The
duration of syncing internal-networkpolicy
- **antrea_controller_runtime_info:** Antrea controller runtime info
(Deprecated since Antrea 0.10.0), defined as labels. The value of the gauge
is always set to 1.

## Common Metrics Provided by Infrastructure
## Apiserver Metrics
Expand Down
20 changes: 0 additions & 20 deletions pkg/agent/metrics/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"k8s.io/component-base/metrics"
"k8s.io/component-base/metrics/legacyregistry"
"k8s.io/klog"

"github.com/vmware-tanzu/antrea/pkg/util/env"
)

var (
Expand Down Expand Up @@ -123,24 +121,6 @@ var (
func InitializePrometheusMetrics() {
klog.Info("Initializing prometheus metrics")

nodeName, err := env.GetNodeName()
if err != nil {
klog.Errorf("Failed to retrieve agent K8S node name: %v", err)
}
deprecatedGaugeHost := metrics.NewGauge(&metrics.GaugeOpts{
Name: "antrea_agent_runtime_info",
Help: "Antrea agent runtime info (Deprecated since Antrea 0.10.0), defined as labels. The value of the gauge is always set to 1.",
ConstLabels: metrics.Labels{"k8s_nodename": nodeName, "k8s_podname": env.GetPodName()},
StabilityLevel: metrics.STABLE,
DeprecatedVersion: "0.10.0",
})
if err := legacyregistry.Register(deprecatedGaugeHost); err != nil {
klog.Error("Failed to register antrea_agent_runtime_info with Prometheus")
}
// This must be after registering the metrics.Gauge as it is lazily instantiated
// and will not measure anything unless the collector is first registered.
deprecatedGaugeHost.Set(1)

InitializePodMetrics()
InitializeNetworkPolicyMetrics()
InitializeOVSMetrics()
Expand Down
20 changes: 0 additions & 20 deletions pkg/controller/metrics/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"k8s.io/component-base/metrics"
"k8s.io/component-base/metrics/legacyregistry"
"k8s.io/klog"

"github.com/vmware-tanzu/antrea/pkg/util/env"
)

var (
Expand Down Expand Up @@ -74,24 +72,6 @@ var (
func InitializePrometheusMetrics() {
klog.Info("Initializing prometheus metrics")

nodeName, err := env.GetNodeName()
if err != nil {
klog.Errorf("Failed to retrieve controller K8S node name: %v", err)
}
deprecatedGaugeHost := metrics.NewGauge(&metrics.GaugeOpts{
Name: "antrea_controller_runtime_info",
Help: "Antrea controller runtime info (Deprecated since Antrea 0.10.0), defined as labels. The value of the gauge is always set to 1.",
ConstLabels: metrics.Labels{"k8s_nodename": nodeName, "k8s_podname": env.GetPodName()},
StabilityLevel: metrics.STABLE,
DeprecatedVersion: "0.10.0",
})
if err = legacyregistry.Register(deprecatedGaugeHost); err != nil {
klog.Errorf("Failed to register antrea_controller_runtime_info with Prometheus: %s", err.Error())
}
// This must be after registering the metrics.Gauge as it is lazily instantiated
// and will not measure anything unless the collector is first registered.
deprecatedGaugeHost.Set(1)

if err := legacyregistry.Register(OpsAppliedToGroupProcessed); err != nil {
klog.Errorf("Failed to register antrea_controller_applied_to_group_processed with Prometheus: %s", err.Error())
}
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ var antreaAgentMetrics = []string{
"antrea_agent_ovs_flow_ops_error_count",
"antrea_agent_ovs_flow_ops_latency_milliseconds",
"antrea_agent_ovs_total_flow_count",
"antrea_agent_runtime_info",
"antrea_agent_conntrack_total_connection_count",
"antrea_agent_conntrack_antrea_connection_count",
"antrea_agent_conntrack_max_connection_count",
Expand All @@ -59,7 +58,6 @@ var antreaControllerMetrics = []string{
"antrea_controller_length_network_policy_queue",
"antrea_controller_network_policy_processed",
"antrea_controller_network_policy_sync_duration_milliseconds",
"antrea_controller_runtime_info",
}

var prometheusEnabled bool
Expand Down