From 6249f30bff90134f08aa02982c3c3924593d622f Mon Sep 17 00:00:00 2001 From: Nont Date: Fri, 22 Sep 2023 12:37:44 -0500 Subject: [PATCH] Add logs for testing This commit will be removed after the testing in INT is done --- pkg/monitor/azure/nsg/nsg.go | 3 +++ pkg/monitor/cluster/arooperatorheartbeat.go | 3 ++- pkg/monitor/cluster/cluster.go | 2 +- pkg/monitor/monitor.go | 1 + pkg/monitor/worker.go | 6 ++++++ 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/monitor/azure/nsg/nsg.go b/pkg/monitor/azure/nsg/nsg.go index 0996711a491..774b905e85a 100644 --- a/pkg/monitor/azure/nsg/nsg.go +++ b/pkg/monitor/azure/nsg/nsg.go @@ -156,6 +156,9 @@ func (n *NSGMonitor) Monitor(ctx context.Context) { r := newRuleChecker(n.log, masterSubnet.prefix, workerPrefixes, &rule) if r.isInvalidDenyRule() { + // TODO remove after testing + n.log.Infof("%s is an invalid rule", *r.rule.Name) + dims := map[string]string{ DimClusterResourceID: n.oc.ID, DimLocation: n.oc.Location, diff --git a/pkg/monitor/cluster/arooperatorheartbeat.go b/pkg/monitor/cluster/arooperatorheartbeat.go index d6f8446f58c..f35a2b0dc54 100644 --- a/pkg/monitor/cluster/arooperatorheartbeat.go +++ b/pkg/monitor/cluster/arooperatorheartbeat.go @@ -23,7 +23,8 @@ func (mon *Monitor) emitAroOperatorHeartbeat(ctx context.Context) error { _, present := aroOperatorDeploymentsReady[d.Name] if present { deploymentIsReady := ready.DeploymentIsReady(&d) - mon.log.Infof("deployment %q is ready: %v, it's status: %+v", d.Name, deploymentIsReady, d.Status) + mon.log.Info("New message") + mon.log.Infof("deploymento %q is ready: %v, it's status: %+v", d.Name, deploymentIsReady, d.Status) aroOperatorDeploymentsReady[d.Name] = deploymentIsReady } } diff --git a/pkg/monitor/cluster/cluster.go b/pkg/monitor/cluster/cluster.go index 06bd66558a3..9f81c5b496b 100644 --- a/pkg/monitor/cluster/cluster.go +++ b/pkg/monitor/cluster/cluster.go @@ -135,7 +135,7 @@ func getHiveClientSet(hiveRestConfig *rest.Config) (client.Client, error) { // Monitor checks the API server health of a cluster func (mon *Monitor) Monitor(ctx context.Context) (errs []error) { - mon.log.Debug("monitoring") + mon.log.Info("monitoring") if mon.hourlyRun { mon.emitGauge("cluster.provisioning", 1, map[string]string{ diff --git a/pkg/monitor/monitor.go b/pkg/monitor/monitor.go index f03005171e6..9b1723da074 100644 --- a/pkg/monitor/monitor.go +++ b/pkg/monitor/monitor.go @@ -83,6 +83,7 @@ func NewMonitor(log *logrus.Entry, dialer proxy.Dialer, dbMonitors database.Moni } func (mon *monitor) Run(ctx context.Context) error { + mon.baseLog.Info("Monitoring has started.") _, err := mon.dbMonitors.Create(ctx, &api.MonitorDocument{ ID: "master", }) diff --git a/pkg/monitor/worker.go b/pkg/monitor/worker.go index 319f9f80186..77384c4290e 100644 --- a/pkg/monitor/worker.go +++ b/pkg/monitor/worker.go @@ -230,6 +230,7 @@ out: // workOne checks the API server health of a cluster func (mon *monitor) workOne(ctx context.Context, log *logrus.Entry, doc *api.OpenShiftClusterDocument, sub *api.SubscriptionDocument, hourlyRun bool) { + log.Info("workOne has started") ctx, cancel := context.WithTimeout(ctx, 50*time.Second) defer cancel() @@ -248,7 +249,10 @@ func (mon *monitor) workOne(ctx context.Context, log *logrus.Entry, doc *api.Ope } var nsgMon *nsg.NSGMonitor + log.Info(doc.OpenShiftCluster.Properties.NetworkProfile.PreconfiguredNSG, hourlyRun) if doc.OpenShiftCluster.Properties.NetworkProfile.PreconfiguredNSG == api.PreconfiguredNSGEnabled && hourlyRun { + // TODO remove after testing + log.Info("NSG Monitoring is starting for ", doc.ID) fpAuthorizer, err := mon.env.FPAuthorizer(sub.Subscription.Properties.TenantID, mon.env.Environment().ResourceManagerEndpoint) if err != nil { @@ -281,6 +285,8 @@ func (mon *monitor) workOne(ctx context.Context, log *logrus.Entry, doc *api.Ope if err != nil { log.Error("Error occurred during NSG monitoring", err) } + // TODO remove after testing + log.Info("NSG monitoring completed successfully for ", doc.ID) case <-ctx.Done(): log.Info("NSG Monitoring timed out") mon.m.EmitGauge(nsg.MetricNSGMonitoringTimedOut, int64(1), map[string]string{