Skip to content

Commit 3874146

Browse files
author
Amy Tobey
authored
SRE-3 disable otel streaminginterceptor (#49)
This is generating so many events in cacher it's destroying our tracing budget. The data generated didn't seem very useful either so let's disable by default and turn it on on a case-by-case basis. Signed-off-by: Amy Tobey <atobey@equinix.com>
1 parent cec6796 commit 3874146

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

grpc/grpc.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ type Option func(*Server)
5050
// A tls server is setup if keys are provided in either the environment variables GRPC_CERT/GRPC_KEY, or using the X509KeyPair or LoadX509KeyPair helper funcs.
5151
// Logging is always setup using the provided log.Logger.
5252
// Prometheus is always setup using the default prom interceptors and Register func.
53+
// OpenTelemetry is setup for unary servers, but NOT streaming servers. Use StreamingInterceptor to add it if you really want/need it.
5354
//
5455
// req is called after the server has been setup.
5556
// This is where your service is gets registered with grpc, equivalent to pb.RegisterMyServiceServer(s, &myServiceImpl{}).
@@ -62,7 +63,6 @@ func NewServer(l log.Logger, reg ServiceRegister, options ...Option) (*Server, e
6263
s.streamers = append(s.streamers,
6364
logStream,
6465
grpc_prometheus.StreamServerInterceptor,
65-
otelgrpc.StreamServerInterceptor(),
6666
)
6767
s.unariers = append(s.unariers,
6868
logUnary,
@@ -260,7 +260,8 @@ func LoadX509KeyPair(certFile, keyFile string) Option {
260260
}
261261

262262
// StreamInterceptor adds the argument to the list of interceptors in a grpc_middleware.Chain
263-
// Logging, Prometheus, and OpenTelemetry interceptors are always included in the set
263+
// Logging and Prometheus interceptors are always included in the set. OpenTelemetry is NOT
264+
// included by default on streams because it's noisy and can't be on by default.
264265
func StreamInterceptor(si grpc.StreamServerInterceptor) Option {
265266
return func(s *Server) {
266267
s.streamers = append(s.streamers, si)

0 commit comments

Comments
 (0)