Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smacker/opentracing-go-redis
OpenTracing instrumentation for go-redis.
https://github.com/smacker/opentracing-go-redis
golang opentracing redis
Last synced: 23 days ago
JSON representation
OpenTracing instrumentation for go-redis.
- Host: GitHub
- URL: https://github.com/smacker/opentracing-go-redis
- Owner: smacker
- License: mit
- Created: 2017-07-06T08:48:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T02:04:39.000Z (over 1 year ago)
- Last Synced: 2024-10-04T12:54:29.077Z (about 1 month ago)
- Topics: golang, opentracing, redis
- Language: Go
- Homepage:
- Size: 29.3 KB
- Stars: 25
- Watchers: 3
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# opentracing go-redis
[OpenTracing](http://opentracing.io/) instrumentation for [go-redis](https://github.com/go-redis/redis).
## Install
```
go get -u github.com/smacker/opentracing-go-redis
```## Usage
Clone redis client `c := otredis.WrapRedisClient(ctx, c)` with a span.
Example:
```go
var client *redis.Clientfunc 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](LICENSE)