OpenTracing instrumentation for the asyncio Redis library
Project description
AIORedis-OpenTracing
This package enables distributed tracing for the Python asyncio Redis library via The OpenTracing Project
.
It is heavily influenced by the Redis Opentracing implementation.
Installation
Run the following command:
$ pip install AIORedis-Opentracing
Getting started
Tracing a AIORedis client requires calling init_tracing()
and optionally specify an OpenTracing-compatible tracer.
import aioredis
import aioredis_opentracing
# If not provided, opentracing.tracer will be used.
aioredis_opentracing.init_tracing(tracer)
redis = await aioredis.create_redis_pool('redis://localhost')
await redis.set('last_access', datetime.datetime.now())
It's possible to trace only specific pipelines:
aioredis_opentracing.init_tracing(tracer)
pipe = redis.multi_exec()
aioredis_opentracing.trace_pipeline(pipe)
# This pipeline will be executed as a single MULTI command.
pipe.set('key1', 'value1')
pipe.set('key2', 'value2')
ok1, ok2 = await pipe.execute()
When pipeline commands are executed as a transaction, these commands will be grouped under a single MULTI
operation. They'll also appear as a single operation in the trace. Outside of a transaction, each command will generate a span.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for AIORedis-OpenTracing-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | df627d70de1f209f3b7aec4db98601cdc61cbab959bea064d1dd5b12c779a976 |
|
MD5 | 00018fb09fa399636f20e8e4595ccd28 |
|
BLAKE2b-256 | 086bf9555efbcd41c3a609c0831f3c75a095e918bdbdd6190bcd63bfeca94e7a |