You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
buildx/vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc
Tonis Tiigi 8b7c38e61a vendor: add buildkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
6 years ago
..
README.md vendor: add buildkit 6 years ago
client.go vendor: add buildkit 6 years ago
errors.go vendor: add buildkit 6 years ago
options.go vendor: add buildkit 6 years ago
package.go vendor: add buildkit 6 years ago
server.go vendor: add buildkit 6 years ago
shared.go vendor: add buildkit 6 years ago

README.md

OpenTracing support for gRPC in Go

The otgrpc package makes it easy to add OpenTracing support to gRPC-based systems in Go.

Installation

go get github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc

Documentation

See the basic usage examples below and the package documentation on godoc.org.

Client-side usage example

Wherever you call grpc.Dial:

// You must have some sort of OpenTracing Tracer instance on hand.
var tracer opentracing.Tracer = ...
...

// Set up a connection to the server peer.
conn, err := grpc.Dial(
    address,
    ... // other options
    grpc.WithUnaryInterceptor(
        otgrpc.OpenTracingClientInterceptor(tracer)),
    grpc.WithStreamInterceptor(
        otgrpc.OpenTracingStreamClientInterceptor(tracer)))

// All future RPC activity involving `conn` will be automatically traced.

Server-side usage example

Wherever you call grpc.NewServer:

// You must have some sort of OpenTracing Tracer instance on hand.
var tracer opentracing.Tracer = ...
...

// Initialize the gRPC server.
s := grpc.NewServer(
    ... // other options
    grpc.UnaryInterceptor(
        otgrpc.OpenTracingServerInterceptor(tracer)),
    grpc.StreamInterceptor(
        otgrpc.OpenTracingStreamServerInterceptor(tracer)))

// All future RPC activity involving `s` will be automatically traced.