Skip to content

Commit 61f2c85

Browse files
committed
Add comments mentioned in an issue open-telemetry#1919
1 parent 5e8b7ab commit 61f2c85

File tree

1 file changed

+36
-1
lines changed
  • instrumentation/opentelemetry-instrumentation-asyncio

1 file changed

+36
-1
lines changed

instrumentation/opentelemetry-instrumentation-asyncio/README.rst

+36-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,42 @@ OpenTelemetry asyncio Instrumentation
66
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-asyncio.svg
77
:target: https://pypi.org/project/opentelemetry-instrumentation-asyncio/
88

9-
This library allows tracing requests made by the asyncio library.
9+
AsyncioInstrumentor: Tracing Requests Made by the Asyncio Library
10+
11+
Primary Use Case:
12+
-----------------
13+
1. Performance and Error Monitoring:
14+
The AsyncioInstrumentor tool offers significant advantages for developers and system administrators. It's designed to monitor real-time performance bottlenecks and catch exceptions within specific asynchronous tasks.
15+
16+
When It's Not Ideal to Use AsyncioInstrumentor:
17+
------------------------------------------------
18+
1. Frameworks with Built-in Instrumentation:
19+
If you're utilizing a framework like aiohttp that already includes built-in instrumentation, you might not need this library. In such cases, leveraging the built-in tools of the framework is generally more beneficial than using external ones like AsyncioInstrumentor.
20+
21+
2. Libraries Lacking Instrumentation:
22+
Should you employ a library that isn't inherently instrumented, AsyncioInstrumentor can step in to fill that gap.
23+
24+
3. Concerns about Overhead:
25+
Tracing each task and future consistently can lead to added overhead. As a best practice, it's wise to enable tracing only when crucial, especially during the development stage.
26+
27+
Example
28+
-------
29+
.. code:: python
30+
31+
from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor
32+
AsyncioInstrumentor().instrument()
33+
34+
import asyncio
35+
36+
async def main():
37+
await asyncio.sleep(0.1)
38+
39+
asyncio.run(main())
40+
41+
API
42+
---
43+
44+
1045

1146
Installation
1247
------------

0 commit comments

Comments
 (0)