Tracing raw HTTP requests and responses in the client SDK
Open
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
Let's add a context-manager interface to trace the raw HTTP requests and responses (e.g., logging them in the console) like:
```python
from ai.backend.client.session import AsyncSession
async with AsyncSession() as api_session:
async with api_session.trace(
handler=... # custom callback
) as trace:
await api_session.ComputeSession.get_or_create(...)
...
for reqres_log in trace: # retrieve the log afterwards
print(reqres_log)
```
This will be useful for debugging and interoperability development in external systems.
JIRA Issue: BA-166
Contributor guide
Assessment
This issue has not been assessed yet.