Skip to content

Commit 0fd9e7a

Browse files
alrexmauriciovasquezbernallzchenocelotlc24t
authored
redis: Porting redis instrumentation from contrib repo (open-telemetry#595)
Porting the existing redis instrumentation from the contrib repo to using the OpenTelemetry API and the OpenTelemetry Auto-instrumentation Instrumentor interface. Similiar to the sqlalchemy PR, the main thing that will need updating is to remove the patch/unpatch methods once the instrumentor interface changes have been merged. This is replacing open-telemetry#21 Co-authored-by: Mauricio Vásquez <[email protected]> Co-authored-by: Leighton Chen <[email protected]> Co-authored-by: Diego Hurtado <[email protected]> Co-authored-by: Chris Kleinknecht <[email protected]>
1 parent 2c4dc32 commit 0fd9e7a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.isort.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ multi_line_output=3
1515
skip=target
1616
skip_glob=**/gen/*,.venv*/*,venv*/*
1717
known_first_party=opentelemetry,opentelemetry_example_app
18-
known_third_party=psutil,pytest
18+
known_third_party=psutil,pytest,redis,redis_opentracing

tox.ini

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ envlist =
8787
; opentelemetry-ext-grpc
8888
py3{4,5,6,7,8}-test-ext-grpc
8989

90+
; opentelemetry-ext-redis
91+
py3{4,5,6,7,8}-test-ext-redis
92+
pypy3-test-ext-redis
93+
9094
; Coverage is temporarily disabled for pypy3 due to the pytest bug.
9195
; pypy3-coverage
9296

@@ -132,6 +136,7 @@ changedir =
132136
test-example-basic-tracer: docs/examples/basic_tracer/tests
133137
test-example-http: docs/examples/http/tests
134138
test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests
139+
test-ext-redis: ext/opentelemetry-ext-redis/tests
135140

136141
commands_pre =
137142
; Install without -e to test the actual installation
@@ -179,6 +184,9 @@ commands_pre =
179184
pymysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi
180185
pymysql: pip install {toxinidir}/ext/opentelemetry-ext-pymysql
181186

187+
redis: pip install {toxinidir}/opentelemetry-auto-instrumentation
188+
redis: pip install {toxinidir}/ext/opentelemetry-ext-redis[test]
189+
182190
http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests[test]
183191

184192
jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger
@@ -239,6 +247,7 @@ deps =
239247
Deprecated
240248
thrift
241249
pymongo
250+
redis
242251
flask
243252
pymysql
244253
mysql-connector-python
@@ -262,10 +271,10 @@ deps =
262271

263272
commands_pre =
264273
pip install -e {toxinidir}/opentelemetry-api \
274+
-e {toxinidir}/opentelemetry-auto-instrumentation \
265275
-e {toxinidir}/opentelemetry-sdk \
266276
-e {toxinidir}/ext/opentelemetry-ext-http-requests \
267277
-e {toxinidir}/ext/opentelemetry-ext-wsgi \
268-
-e {toxinidir}/opentelemetry-auto-instrumentation \
269278
-e {toxinidir}/ext/opentelemetry-ext-flask
270279

271280
commands =
@@ -279,19 +288,22 @@ deps =
279288
pymongo ~= 3.1
280289
pymysql ~= 0.9.3
281290
psycopg2-binary ~= 2.8.4
291+
redis ~= 3.3.11
282292

283293
changedir =
284294
ext/opentelemetry-ext-docker-tests/tests
285295

286296
commands_pre =
287297
pip install -e {toxinidir}/opentelemetry-api \
288298
-e {toxinidir}/opentelemetry-sdk \
299+
-e {toxinidir}/opentelemetry-auto-instrumentation \
289300
-e {toxinidir}/tests/util \
290301
-e {toxinidir}/ext/opentelemetry-ext-dbapi \
291302
-e {toxinidir}/ext/opentelemetry-ext-mysql \
292303
-e {toxinidir}/ext/opentelemetry-ext-psycopg2 \
293304
-e {toxinidir}/ext/opentelemetry-ext-pymongo \
294-
-e {toxinidir}/ext/opentelemetry-ext-pymysql
305+
-e {toxinidir}/ext/opentelemetry-ext-pymysql \
306+
-e {toxinidir}/ext/opentelemetry-ext-redis
295307
docker-compose up -d
296308
python check_availability.py
297309
commands =

0 commit comments

Comments
 (0)