Skip to content

Commit

Permalink
Delete deprecated Prometheus metrics (#1503)
Browse files Browse the repository at this point in the history
antrea_agent_runtime_info and antrea_controller_runtime_info are
deprecated since 0.10.0 release. Deleting them from 0.11.0 release.
  • Loading branch information
srikartati authored Nov 9, 2020
1 parent dceef6b commit 14cc500
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 47 deletions.
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

0 comments on commit 14cc500

Please sign in to comment.