रेडिस¶
logfire.instrument_redis() विधि होगी रेडिस क्लाइंट पक्ष द्वारा निष्पादित प्रत्येक कमांड एक स्पैन बनाता है।
स्थापित करें¶
उपयोग redis अतिरिक्त स्थापना logfire यह क्या है?
{{ install_logfire(extras=['redis']) }}
उपयोग¶
आइए निम्नलिखित न्यूनतम उदाहरण पर एक नज़र डालें:
main.py
import logfire
import redis
logfire.configure()
logfire.instrument_redis()
# This will report a span with the default settings
client = redis.StrictRedis(host="localhost", port=6379)
client.get("my-key")
# This will report a span with the default settings
async def main():
client = redis.asyncio.Redis(host="localhost", port=6379)
await client.get("my-key")
if __name__ == "__main__":
import asyncio
asyncio.run(main())
logfire.instrument_redis() कीवर्ड पैरामीटर को टेलीमेट्री रेडिस इंस्ट्रूमेंटेशन पैकेज में पास किया जाता है RedisInstrumentor().instrument() विधि,कृपया यहां क्लिक करें। इसके बारे में और पढ़ें।
[रेडिस]: https://redis.readthedocs.io/en/stable /
本文总阅读量次