Skip to content
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
6 changes: 3 additions & 3 deletions pkg/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ func (d *Deployment) run() {
}

case <-d.inspectTrigger.Done():
log.Debug("Inspect deployment...")
log.Trace("Inspect deployment...")
inspectionInterval = d.inspectDeployment(inspectionInterval)
log.Str("interval", inspectionInterval.String()).Debug("...inspected deployment")
log.Str("interval", inspectionInterval.String()).Trace("...inspected deployment")

case <-d.inspectCRDTrigger.Done():
d.lookForServiceMonitorCRD()
Expand Down Expand Up @@ -548,7 +548,7 @@ func (d *Deployment) updateCRSpec(ctx context.Context, newSpec api.DeploymentSpe

if len(force) == 0 || !force[0] {
if d.apiObject.Spec.Equal(&newSpec) {
d.log.Debug("Nothing to update in updateCRSpec")
d.log.Trace("Nothing to update in updateCRSpec")
// Nothing to update
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/deployment/deployment_inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (d *Deployment) inspectDeployment(lastInterval util.Interval) util.Interval
ctxReconciliation, cancelReconciliation := globals.GetGlobalTimeouts().Reconciliation().WithTimeout(context.Background())
defer cancelReconciliation()
defer func() {
d.log.Info("Inspect loop took %s", time.Since(start))
d.log.Trace("Inspect loop took %s", time.Since(start))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same here as below comment

}()

nextInterval := lastInterval
Expand Down Expand Up @@ -152,7 +152,7 @@ func (d *Deployment) inspectDeploymentWithError(ctx context.Context, lastInterva
t := time.Now()

defer func() {
d.log.Info("Reconciliation loop took %s", time.Since(t))
d.log.Trace("Reconciliation loop took %s", time.Since(t))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should have here INFO or WARNING when time.Since(t) is higher than some value (e.g. 5 seconds).
Then we would know that the reconciliation loop took too long and should be investigated. e.g.:
if time.Since(t) > time.Second * 10 {
d.log.Info("Reconciliation loop took too long %s", time.Since(t))
} else {
d.log.Trace("Reconciliation loop took %s", time.Since(t))
}

}()

// Ensure that spec and status checksum are same
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/resources/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type PatchFunc func(name string, d []byte) error
func (r *Resources) EnsureAnnotations(ctx context.Context, cachedStatus inspectorInterface.Inspector) error {
log := r.log.Str("section", "annotations")

log.Info("Ensuring annotations")
log.Trace("Ensuring annotations")

patchSecret := func(name string, d []byte) error {
return globals.GetGlobalTimeouts().Kubernetes().RunWithTimeout(ctx, func(ctxChild context.Context) error {
Expand Down
12 changes: 6 additions & 6 deletions pkg/deployment/resources/inspector/inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,14 @@ func (i *inspectorState) refreshInThreads(ctx context.Context, threads int, load
logger := logger.Str("namespace", i.namespace).Str("name", i.deploymentName)

start := time.Now()
logger.Debug("Pre-inspector refresh start")
logger.Trace("Pre-inspector refresh start")
d, err := i.client.Arango().DatabaseV1().ArangoDeployments(i.namespace).Get(context.Background(), i.deploymentName, meta.GetOptions{})
n.deploymentResult = &inspectorStateDeploymentResult{
depl: d,
err: err,
}

logger.Debug("Inspector refresh start")
logger.Trace("Inspector refresh start")

for id := range loaders {
go func(id int) {
Expand All @@ -362,14 +362,14 @@ func (i *inspectorState) refreshInThreads(ctx context.Context, threads int, load
t := n.throttles.Get(c)

if !t.Throttle() {
logger.Str("component", string(c)).Debug("Inspector refresh skipped")
logger.Str("component", string(c)).Trace("Inspector refresh skipped")
return
}

logger.Str("component", string(c)).Debug("Inspector refresh")
logger.Str("component", string(c)).Trace("Inspector refresh")

defer func() {
logger.Str("component", string(c)).SinceStart("duration", start).Debug("Inspector done")
logger.Str("component", string(c)).SinceStart("duration", start).Trace("Inspector done")
t.Delay()
}()

Expand All @@ -384,7 +384,7 @@ func (i *inspectorState) refreshInThreads(ctx context.Context, threads int, load

m.Wait()

logger.SinceStart("duration", start).Debug("Inspector refresh done")
logger.SinceStart("duration", start).Trace("Inspector refresh done")

for id := range loaders {
if err := loaders[id].Verify(n); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/resources/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
func (r *Resources) EnsureLabels(ctx context.Context, cachedStatus inspectorInterface.Inspector) error {
log := r.log.Str("section", "labels")

log.Debug("Ensure labels")
log.Trace("Ensure labels")

if err := r.EnsureSecretLabels(ctx, cachedStatus); err != nil {
return err
Expand Down
4 changes: 1 addition & 3 deletions pkg/operator/operator_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ func (o *Operator) onUpdateArangoDeployment(oldObj, newObj interface{}) {
defer o.Dependencies.LivenessProbe.Unlock()

apiObject := newObj.(*api.ArangoDeployment)
o.log.
Str("name", apiObject.GetObjectMeta().GetName()).
Debug("ArangoDeployment updated")
o.log.Str("name", apiObject.GetObjectMeta().GetName()).Trace("ArangoDeployment updated")
o.syncArangoDeployment(apiObject)
}

Expand Down