Skip to content

chengjiagan/twirp-opentelemetry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTelemetry Hooks for Twirp

The oteltwirp package creates an OpenTelemetry Twirp hook to use in your server. Derived from twirp-opentracing and otelgrpc.

Installation

go get -u github.com/chengjiagan/twirp-opentelemetry

Server-side usage example

Where you are instantiating your Twirp server:

hooks := NewOpenTracingHooks()
service := haberdasherserver.New()
server := WithTraceContext(haberdasher.NewHaberdasherServer(service, hooks))
log.Fatal(http.ListenAndServe(":8080", server))

Client-side usage example

When instantiating your Twirp client:

client := haberdasher.NewHaberdasherProtobufClient(url, NewTraceHTTPClient(http.DefaultClient))

About

Simple OpenTelemetry hooks for Twirp

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages