diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go index fde18e4ab6..190ae2360f 100644 --- a/pkg/metrics/metrics.go +++ b/pkg/metrics/metrics.go @@ -40,7 +40,7 @@ func InitializeMetrics() { utils.ForwardBytesGaugeName, forwardBytesGaugeDescription, utils.Direction) - WindowsGauge = exporter.CreatePrometheusGaugeVecForMetric( + HNSStatsGauge = exporter.CreatePrometheusGaugeVecForMetric( exporter.DefaultRegistry, hnsStats, hnsStatsDescription, diff --git a/pkg/metrics/types.go b/pkg/metrics/types.go index cff5c28884..562d8612e7 100644 --- a/pkg/metrics/types.go +++ b/pkg/metrics/types.go @@ -56,7 +56,8 @@ var ( ForwardPacketsGauge GaugeVec ForwardBytesGauge GaugeVec - WindowsGauge GaugeVec + // Windows + HNSStatsGauge GaugeVec // Common gauges across os distributions NodeConnectivityStatusGauge GaugeVec diff --git a/pkg/plugin/hnsstats/hnsstats_windows.go b/pkg/plugin/hnsstats/hnsstats_windows.go index a668dce4f9..dd93db438f 100644 --- a/pkg/plugin/hnsstats/hnsstats_windows.go +++ b/pkg/plugin/hnsstats/hnsstats_windows.go @@ -174,14 +174,14 @@ func notifyHnsStats(h *hnsstats, stats *HnsStatsData) { metrics.ForwardBytesGauge.WithLabelValues(ingressLabel).Set(float64(stats.hnscounters.BytesReceived)) h.l.Debug("emitting bytes received count metric", zap.Uint64(BytesReceived, stats.hnscounters.BytesReceived)) - metrics.WindowsGauge.WithLabelValues(PacketsReceived).Set(float64(stats.hnscounters.PacketsReceived)) - metrics.WindowsGauge.WithLabelValues(PacketsSent).Set(float64(stats.hnscounters.PacketsSent)) + metrics.HNSStatsGauge.WithLabelValues(PacketsReceived).Set(float64(stats.hnscounters.PacketsReceived)) + metrics.HNSStatsGauge.WithLabelValues(PacketsSent).Set(float64(stats.hnscounters.PacketsSent)) metrics.DropPacketsGauge.WithLabelValues(utils.Endpoint, egressLabel).Set(float64(stats.hnscounters.DroppedPacketsOutgoing)) metrics.DropPacketsGauge.WithLabelValues(utils.Endpoint, ingressLabel).Set(float64(stats.hnscounters.DroppedPacketsIncoming)) if stats.vfpCounters == nil { - h.l.Warn("will not record some metrics since VFP port counters failed to be set") + h.l.Debug("will not record some metrics since VFP port counters failed to be set") return } diff --git a/pkg/utils/attr_utils.go b/pkg/utils/attr_utils.go index 6826db74c9..e5266e9b02 100644 --- a/pkg/utils/attr_utils.go +++ b/pkg/utils/attr_utils.go @@ -6,10 +6,6 @@ import ( "go.opentelemetry.io/otel/attribute" ) -const ( - unknown = "__uknown__" -) - var ( pluginKey = attribute.Key("plugin") eventTypeKey = attribute.Key("event_type")