Skip to content

Commit

Permalink
Discard the otel logs (#5146)
Browse files Browse the repository at this point in the history
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
  • Loading branch information
Warashi authored Aug 27, 2024
1 parent 6301594 commit 30da3af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ require (
github.com/envoyproxy/go-control-plane v0.12.0
github.com/envoyproxy/protoc-gen-validate v1.0.4
github.com/fsouza/fake-gcs-server v1.21.0
github.com/go-logr/logr v1.4.2
github.com/go-sql-driver/mysql v1.6.0
github.com/goccy/go-yaml v1.9.8
github.com/golang-jwt/jwt v3.2.1+incompatible
Expand Down Expand Up @@ -114,7 +115,6 @@ require (
github.com/fatih/color v1.10.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
Expand Down
6 changes: 6 additions & 0 deletions pkg/app/piped/cmd/piped/piped.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
secretmanagerpb "cloud.google.com/go/secretmanager/apiv1/secretmanagerpb"
awsconfig "github.com/aws/aws-sdk-go-v2/config"
awssecretsmanager "github.com/aws/aws-sdk-go-v2/service/secretsmanager"
"github.com/go-logr/logr"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -241,6 +242,11 @@ func (p *piped) run(ctx context.Context, input cli.Input) (runErr error) {
}
otel.SetTracerProvider(tracerProvider)

// if control plane's flag monitoring.enabled is false, otel provider logs errors.
// it's no problem but we don't want to see it.
// so we discard the logger.
otel.SetLogger(logr.Discard())

// Send the newest piped meta to the control-plane.
if err := p.sendPipedMeta(ctx, apiClient, cfg, input.Logger); err != nil {
input.Logger.Error("failed to report piped meta to control-plane", zap.Error(err))
Expand Down

0 comments on commit 30da3af

Please sign in to comment.