Use request_ctx to determine whether or not _teardown_request should end flask span (#1692)

Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
This commit is contained in:
Matthew Grossman
2023-06-13 04:23:48 -07:00
committed by GitHub
parent fc547877d3
commit 4637912418
7 changed files with 104 additions and 19 deletions

14
tox.ini
View File

@ -84,8 +84,8 @@ envlist =
pypy3-test-instrumentation-fastapi
; opentelemetry-instrumentation-flask
py3{7,8,9,10,11}-test-instrumentation-flask
pypy3-test-instrumentation-flask
py3{7,8,9,10,11}-test-instrumentation-flask{213,220}
pypy3-test-instrumentation-flask{213,220}
; opentelemetry-instrumentation-urllib
py3{7,8,9,10,11}-test-instrumentation-urllib
@ -258,6 +258,8 @@ deps =
falcon1: falcon ==1.4.1
falcon2: falcon >=2.0.0,<3.0.0
falcon3: falcon >=3.0.0,<4.0.0
flask213: Flask ==2.1.3
flask220: Flask >=2.2.0
grpc: pytest-asyncio
sqlalchemy11: sqlalchemy>=1.1,<1.2
sqlalchemy14: aiosqlite
@ -304,7 +306,7 @@ changedir =
test-instrumentation-elasticsearch{2,5,6}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests
test-instrumentation-falcon{1,2,3}: instrumentation/opentelemetry-instrumentation-falcon/tests
test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests
test-instrumentation-flask: instrumentation/opentelemetry-instrumentation-flask/tests
test-instrumentation-flask{213,220}: instrumentation/opentelemetry-instrumentation-flask/tests
test-instrumentation-urllib: instrumentation/opentelemetry-instrumentation-urllib/tests
test-instrumentation-urllib3: instrumentation/opentelemetry-instrumentation-urllib3/tests
test-instrumentation-grpc: instrumentation/opentelemetry-instrumentation-grpc/tests
@ -365,8 +367,8 @@ commands_pre =
grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test]
falcon{1,2,3},flask,django{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,requests,urllib,urllib3,wsgi: pip install {toxinidir}/util/opentelemetry-util-http[test]
wsgi,falcon{1,2,3},flask,django{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test]
falcon{1,2,3},flask{213,220},django{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,requests,urllib,urllib3,wsgi: pip install {toxinidir}/util/opentelemetry-util-http[test]
wsgi,falcon{1,2,3},flask{213,220},django{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test]
asgi,django{3,4},starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi[test]
asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test]
@ -380,7 +382,7 @@ commands_pre =
falcon{1,2,3}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test]
flask: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test]
flask{213,220}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test]
urllib: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib[test]