aio-libs / aio-libs/aiohttp

tracing support enhancements

未关闭
#3,084 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Python
星标
16.5k
派生
2.4k
平均合并
17 小时 22 分钟
30 天内合并 PR
212

描述

## Long story short

After writing an ugly 2.x monkeypatch for client tracing support in datadog: https://github.com/DataDog/dd-trace-py/pull/294 a new aiohttp tracing strategy was discussed and created. I'm now trying to move this PR to use the new tracing support however have run into a few issues.

## Expected behaviour

Ability to trace major network activities in aiohttp

## Actual behaviour

1. Unable to trace when aiohttp is waiting for a request response headers: https://github.com/aio-libs/aiohttp/blob/v3.3.1/aiohttp/client.py#L387
2. Unable to trace chunked stream reads via `StreamReader.read()`

## Steps to reproduce

TBD

## Your environment

aiohttp 3.3.1

## Other Thoughts from a client perspective

1. Initially I thought a trace was missing for req.send: https://github.com/aio-libs/aiohttp/blob/v3.3.1/aiohttp/client.py#L385 however after tracing through that method and what it calls I don't think it needs to be an async function.
2. I think it would be a lot simpler if there was a trace per while loop of redirects, otherwise I have to piece together conn timeout + header send + header response
3. I'm not sure what `send_response_chunk_received` represents? It would be nice if there was a diagram describing when each one happens.
4. seems weird having `send_request_chunk_sent` w/o a received, basically sending request but never got response? What I see on a request from aiobotocore is: send_request_start -> send_conn_create_start -> send_conn_create_end -> send_request_chunk_sent -> send_request_end

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。