विषय पर बढ़ें

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() उपयोग ओपनटेलीमेट्री HTTPX इंस्ट्रूमेंटेशन बैग, आप कर सकते हैंयहाँ यह है। पैकेज के बारे में अधिक जानकारी प्राप्त करें।

[Httpx]: https://www.python-httpx.org /


本文总阅读量次