콘텐츠로 이동

HTTPX

logfire.instrument_httpx() 방법을 사용할 수 있습니다. 로그파이어 탐지 HTTPX...

설치

httpx 추가와 함께 logfire 설치:

{{ install_logfire(extras=['httpx']) }}

사용법

최소한의 예를 살펴보겠습니다.python main.py 를 사용하여 실행할 수 있습니다.

main.py
import logfire
import httpx

logfire.configure()
logfire.instrument_httpx()

url = "https://httpbin.org/get"

with httpx.Client() as client:
    client.get(url)


async def main():
    async with httpx.AsyncClient() as client:
        await client.get(url)


if __name__ == "__main__":
    import asyncio

    asyncio.run(main())

logfire.instrument_httpx() 사용 OpenTelemetry HTTPX 계측 가방, 넌 할 수 있어여기 있습니다.패키지에 대해 자세히 알아보십시오.


本文总阅读量次