Skip to content

Commit

Permalink
Add doc for opentracing support
Browse files Browse the repository at this point in the history
Mention the fact that the client must be initialized with an opentracing interceptor to allow the propagation of spans through the gateway.
  • Loading branch information
vthiery authored and johanbrandhorst committed Aug 9, 2019
1 parent 643a3cf commit b6e6efb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/_docs/customizingyourgateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,28 @@ if err := http.ListenAndServe(":8080", tracingWrapper(mux)); err != nil {
}
```

Finally, don't forget to add a tracing interceptor when registering
the services. E.g.
```go
import (
...
"google.golang.org/grpc"
"github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
)
opts := []grpc.DialOption{
grpc.WithUnaryInterceptor(
grpc_opentracing.UnaryClientInterceptor(
grpc_opentracing.WithTracer(opentracing.GlobalTracer()),
),
),
}
if err := pb.RegisterMyServiceHandlerFromEndpoint(ctx, mux, serviceEndpoint, opts); err != nil {
log.Fatalf("could not register HTTP service: %v", err)
}
```
## Error handler
http://mycodesmells.com/post/grpc-gateway-error-handler
Expand Down

0 comments on commit b6e6efb

Please sign in to comment.