Skip to content

Commit

Permalink
[supervisor] allow to enable grpc tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
akosyakov committed Mar 19, 2021
1 parent 33d4df7 commit 51baf78
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/supervisor/pkg/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import (
"github.com/gitpod-io/gitpod/supervisor/pkg/ports"
"github.com/gitpod-io/gitpod/supervisor/pkg/terminal"
daemon "github.com/gitpod-io/gitpod/ws-daemon/api"

grpc_logrus "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus"
)

var (
Expand Down Expand Up @@ -575,6 +577,13 @@ func startAPIEndpoint(ctx context.Context, cfg *Config, wg *sync.WaitGroup, serv
log.WithError(err).Fatal("cannot start health endpoint")
}

if cfg.DebugEnable {
opts = append(opts,
grpc.UnaryInterceptor(grpc_logrus.UnaryServerInterceptor(log.Log)),
grpc.StreamInterceptor(grpc_logrus.StreamServerInterceptor(log.Log)),
)
}

m := cmux.New(l)
restMux := grpcruntime.NewServeMux()
grpcMux := m.MatchWithWriters(cmux.HTTP2MatchHeaderFieldSendSettings("content-type", "application/grpc"))
Expand Down

0 comments on commit 51baf78

Please sign in to comment.