|
28 | 28 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 | 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | 30 |
|
| 31 | +import sys |
| 32 | + |
31 | 33 | from elasticapm.utils.module_import import import_string |
32 | 34 |
|
33 | 35 | _cls_register = { |
|
68 | 70 | "elasticapm.instrumentation.packages.kafka.KafkaInstrumentation", |
69 | 71 | "elasticapm.instrumentation.packages.grpc.GRPCClientInstrumentation", |
70 | 72 | "elasticapm.instrumentation.packages.grpc.GRPCServerInstrumentation", |
71 | | - "elasticapm.instrumentation.packages.asyncio.sleep.AsyncIOSleepInstrumentation", |
72 | | - "elasticapm.instrumentation.packages.asyncio.aiohttp_client.AioHttpClientInstrumentation", |
73 | | - "elasticapm.instrumentation.packages.httpx.async.httpx.HttpxAsyncClientInstrumentation", |
74 | | - "elasticapm.instrumentation.packages.asyncio.elasticsearch.ElasticSearchAsyncConnection", |
75 | | - "elasticapm.instrumentation.packages.asyncio.elasticsearch.ElasticsearchAsyncTransportInstrumentation", |
76 | | - "elasticapm.instrumentation.packages.asyncio.aiopg.AioPGInstrumentation", |
77 | | - "elasticapm.instrumentation.packages.asyncio.asyncpg.AsyncPGInstrumentation", |
78 | | - "elasticapm.instrumentation.packages.tornado.TornadoRequestExecuteInstrumentation", |
79 | | - "elasticapm.instrumentation.packages.tornado.TornadoHandleRequestExceptionInstrumentation", |
80 | | - "elasticapm.instrumentation.packages.tornado.TornadoRenderInstrumentation", |
81 | | - "elasticapm.instrumentation.packages.httpx.async.httpcore.HTTPCoreAsyncInstrumentation", |
82 | | - "elasticapm.instrumentation.packages.asyncio.aioredis.RedisConnectionPoolInstrumentation", |
83 | | - "elasticapm.instrumentation.packages.asyncio.aioredis.RedisPipelineInstrumentation", |
84 | | - "elasticapm.instrumentation.packages.asyncio.aioredis.RedisConnectionInstrumentation", |
85 | | - "elasticapm.instrumentation.packages.asyncio.aiomysql.AioMySQLInstrumentation", |
86 | | - "elasticapm.instrumentation.packages.asyncio.aiobotocore.AioBotocoreInstrumentation", |
87 | | - "elasticapm.instrumentation.packages.asyncio.starlette.StarletteServerErrorMiddlewareInstrumentation", |
88 | | - "elasticapm.instrumentation.packages.asyncio.redis_asyncio.RedisAsyncioInstrumentation", |
89 | | - "elasticapm.instrumentation.packages.asyncio.redis_asyncio.RedisPipelineInstrumentation", |
90 | | - "elasticapm.instrumentation.packages.asyncio.psycopg_async.AsyncPsycopgInstrumentation", |
91 | | - "elasticapm.instrumentation.packages.grpc.GRPCAsyncServerInstrumentation", |
92 | 73 | } |
93 | 74 |
|
| 75 | +if sys.version_info >= (3, 7): |
| 76 | + _cls_register.update( |
| 77 | + [ |
| 78 | + "elasticapm.instrumentation.packages.asyncio.sleep.AsyncIOSleepInstrumentation", |
| 79 | + "elasticapm.instrumentation.packages.asyncio.aiohttp_client.AioHttpClientInstrumentation", |
| 80 | + "elasticapm.instrumentation.packages.httpx.async.httpx.HttpxAsyncClientInstrumentation", |
| 81 | + "elasticapm.instrumentation.packages.asyncio.elasticsearch.ElasticSearchAsyncConnection", |
| 82 | + "elasticapm.instrumentation.packages.asyncio.elasticsearch.ElasticsearchAsyncTransportInstrumentation", |
| 83 | + "elasticapm.instrumentation.packages.asyncio.aiopg.AioPGInstrumentation", |
| 84 | + "elasticapm.instrumentation.packages.asyncio.asyncpg.AsyncPGInstrumentation", |
| 85 | + "elasticapm.instrumentation.packages.tornado.TornadoRequestExecuteInstrumentation", |
| 86 | + "elasticapm.instrumentation.packages.tornado.TornadoHandleRequestExceptionInstrumentation", |
| 87 | + "elasticapm.instrumentation.packages.tornado.TornadoRenderInstrumentation", |
| 88 | + "elasticapm.instrumentation.packages.httpx.async.httpcore.HTTPCoreAsyncInstrumentation", |
| 89 | + "elasticapm.instrumentation.packages.asyncio.aioredis.RedisConnectionPoolInstrumentation", |
| 90 | + "elasticapm.instrumentation.packages.asyncio.aioredis.RedisPipelineInstrumentation", |
| 91 | + "elasticapm.instrumentation.packages.asyncio.aioredis.RedisConnectionInstrumentation", |
| 92 | + "elasticapm.instrumentation.packages.asyncio.aiomysql.AioMySQLInstrumentation", |
| 93 | + "elasticapm.instrumentation.packages.asyncio.aiobotocore.AioBotocoreInstrumentation", |
| 94 | + "elasticapm.instrumentation.packages.asyncio.starlette.StarletteServerErrorMiddlewareInstrumentation", |
| 95 | + "elasticapm.instrumentation.packages.asyncio.redis_asyncio.RedisAsyncioInstrumentation", |
| 96 | + "elasticapm.instrumentation.packages.asyncio.redis_asyncio.RedisPipelineInstrumentation", |
| 97 | + "elasticapm.instrumentation.packages.asyncio.psycopg_async.AsyncPsycopgInstrumentation", |
| 98 | + "elasticapm.instrumentation.packages.grpc.GRPCAsyncServerInstrumentation", |
| 99 | + ] |
| 100 | + ) |
| 101 | + |
94 | 102 | # These instrumentations should only be enabled if we're instrumenting via the |
95 | 103 | # wrapper script, which calls register_wrapper_instrumentations() below. |
96 | 104 | _wrapper_register = { |
|
0 commit comments