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