1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-04 09:43:23 +02:00
opentelemetry-go/example/grpc
Andy Schweig 5438916f62
Expose optional ResponseWriter interfaces. (#979)
http.ResponseWriters may implement additional interfaces
(http.CloseNotifier, http.Flusher, http.Hijacker, http.Pusher,
io.ReaderFrom) that get lost when the ResponseWriter is wrapped in
another object. This change uses the httpsnoop package to wrap the
ResponseWriter so that the resulting object implements any of the
optional interfaces that the original ResponseWriter implements as
well as using the replacement ResponseWriter methods that gather
information for tracing.
2020-07-30 10:30:47 -07:00
..
api Resolve #72 - gRPC Interceptor (#621) 2020-04-23 13:07:14 -07:00
client Rename plugin directory to instrumentation (#779) 2020-05-30 14:53:32 -07:00
config Unify trace and metric stdout exporters (#956) 2020-07-22 12:34:44 -07:00
server Rename plugin directory to instrumentation (#779) 2020-05-30 14:53:32 -07:00
go.mod Release v0.10.0 (#990) 2020-07-30 08:57:24 -07:00
go.sum Expose optional ResponseWriter interfaces. (#979) 2020-07-30 10:30:47 -07:00
README.md Unary gRPC tracing example (#351) 2019-11-26 16:14:09 -08:00

gRPC Tracing Example

Traces client and server calls via interceptors.

Compile .proto

Only required if the service definition (.proto) changes.

cd ./example/grpc

# protobuf v1.3.2
protoc -I api --go_out=plugins=grpc,paths=source_relative:./api api/hello-service.proto

Run server

cd ./example/grpc

go run ./server

Run client

go run ./client