From a6ce8b6e9419f789e59ed5114bf074805f0465b6 Mon Sep 17 00:00:00 2001 From: Nont Date: Wed, 25 Oct 2023 09:55:09 -0500 Subject: [PATCH] Add additional metrics --- pkg/monitor/azure/nsg/nsg.go | 1 + pkg/monitor/worker.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/monitor/azure/nsg/nsg.go b/pkg/monitor/azure/nsg/nsg.go index d10c0396c86..4dc8b0ec34c 100644 --- a/pkg/monitor/azure/nsg/nsg.go +++ b/pkg/monitor/azure/nsg/nsg.go @@ -26,6 +26,7 @@ import ( ) const ( + MetricPreconfiguredNSGEnabled = "monitor.preconfigurednsg.enabled" MetricFailedNSGMonitorCreation = "monitor.preconfigurednsg.failedmonitorcreation" MetricInvalidDenyRule = "monitor.preconfigurednsg.invaliddenyrule" MetricSubnetAccessForbidden = "monitor.preconfigurednsg.subnetaccessforbidden" diff --git a/pkg/monitor/worker.go b/pkg/monitor/worker.go index b2d1df01200..8f0ce09ca33 100644 --- a/pkg/monitor/worker.go +++ b/pkg/monitor/worker.go @@ -284,6 +284,7 @@ func (mon *monitor) workOne(ctx context.Context, log *logrus.Entry, doc *api.Ope var wg sync.WaitGroup if doc.OpenShiftCluster.Properties.NetworkProfile.PreconfiguredNSG == api.PreconfiguredNSGEnabled && hourlyRun { + mon.clusterm.EmitGauge(nsg.MetricPreconfiguredNSGEnabled, int64(1), dims) nsgMon := mon.newNSGMonitor(log, doc.OpenShiftCluster, sub.ID, sub.Subscription.Properties.TenantID, mon.clusterm, dims, &wg) monitors = append(monitors, nsgMon) }