lablup / lablup/backend.ai

Tracing raw HTTP requests and responses in the client SDK

Open
#1,799 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.