OpenTracing instrumentation for go-redis.
Switch branches/tags
Nothing to show
Clone or download
Latest commit c01c8f7 Oct 29, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml add .travis.yml Oct 29, 2018
LICENSE add readme and license Oct 29, 2018
README.md add readme and license Oct 29, 2018
otredis.go update to go-redis v6 Oct 29, 2018
otredis_test.go add tests Oct 29, 2018

README.md

opentracing go-redis

OpenTracing instrumentation for go-redis.

Install

go get -u github.com/smacker/opentracing-go-redis

Usage

Clone redis client c := otredis.WrapRedisClient(ctx, c) with a span.

Example:

var client *redis.Client

func Handler(ctx context.Context) {
    span, ctx := opentracing.StartSpanFromContext(ctx, "handler")
    defer span.Finish()

    // clone redis with proper context
    client := otredis.WrapRedisClient(ctx, client)

    // make requests to redis
    client.Get("foo")
}

Call to the Handler function would create redis span as a child of handler span.

License

MIT