The ottwirp
package creates an OpenTracing Twirp hook to use in your server. Derived from grpc-opentracing.
go get -u github.com/twirp-ecosystem/twirp-opentracing
Where you are instantiating your Twirp server:
var tracer opentracing.Tracer = ...
...
hooks := NewOpenTracingHooks(tracer)
service := haberdasherserver.New()
server := WithTraceContext(haberdasher.NewHaberdasherServer(service, hooks), tracer)
log.Fatal(http.ListenAndServe(":8080", server))
When instantiating your Twirp client:
var tracer opentracing.Tracer = ...
...
client := haberdasher.NewHaberdasherProtobufClient(url, NewTraceHTTPClient(http.DefaultClient, tracer))