Skip to content

Commit

Permalink
Bug 1860889: decrease CMO log verbosity from 3 to 2
Browse files Browse the repository at this point in the history
With `-v=3`, the logs are spammed by client-go telling that client
requests have been throttled. Looking at the Kubernetes code, we won't
lose anything useful by lowering the verbosity level.

The change also increases the QPS and burst settings (respectively 5->20
and 10->40) because the default values aren't suited for CMO that runs
lots of tasks in parallel. With QPS=100 and Burst=200, the throttling
logs disappeared but we felt that these values were too high for the API
server.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
  • Loading branch information
simonpasquier committed Aug 24, 2020
1 parent fbcb670 commit 1fa5e80
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
component: "Monitoring"

reviewers:
- brancz
- s-urbaniak
- paulfantom
- LiliC
- pgier
- simonpasquier

approvers:
- brancz
- bparees
- s-urbaniak
- paulfantom
Expand All @@ -18,5 +16,6 @@ approvers:
- simonpasquier

emeritus_approvers:
- brancz
- squat
- metalmatze
4 changes: 4 additions & 0 deletions cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ func Main() int {
return 1
}

// CMO runs many tasks in parallel and the default values for rate limiting are too low.
config.QPS = 20
config.Burst = 40

userWorkloadConfigMapName := "user-workload-monitoring-config"
o, err := cmo.New(config, *releaseVersion, *namespace, *namespaceUserWorkload, *namespaceSelector, *configMapName, userWorkloadConfigMapName, *remoteWrite, images.asMap(), telemetryConfig.Matches)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
- "-configmap=cluster-monitoring-config"
- "-release-version=$(RELEASE_VERSION)"
- "-logtostderr=true"
- "-v=3"
- "-v=2"
- "-images=prometheus-operator=quay.io/openshift/origin-prometheus-operator:latest"
- "-images=prometheus-config-reloader=quay.io/openshift/origin-prometheus-config-reloader:latest"
- "-images=configmap-reloader=quay.io/openshift/origin-configmap-reloader:latest"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ func (c *Client) WaitForDeploymentRollout(dep *appsv1.Deployment) error {
}
if d.Status.UnavailableReplicas != 0 {
lastErr = errors.Errorf("got %d unavailable replicas",
d.Status.UpdatedReplicas)
d.Status.UnavailableReplicas)
return false, nil
}
return true, nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ func (tl *TaskRunner) RunAll() (string, error) {
i := i

g.Go(func() error {
klog.V(3).Infof("running task %d of %d: %v", i+1, len(tl.tasks), ts.Name)
klog.V(2).Infof("running task %d of %d: %v", i+1, len(tl.tasks), ts.Name)
err := tl.ExecuteTask(ts)
klog.V(3).Infof("ran task %d of %d: %v", i+1, len(tl.tasks), ts.Name)
klog.V(2).Infof("ran task %d of %d: %v", i+1, len(tl.tasks), ts.Name)
if err != nil {
return taskErr{error: errors.Wrapf(err, "running task %v failed", ts.Name), name: ts.Name}
}
Expand Down

0 comments on commit 1fa5e80

Please sign in to comment.