Skip to content

Commit

Permalink
Add consistent import statement for URLLibInstrumentor (open-telemetr…
Browse files Browse the repository at this point in the history
…y#2868)

* Add consistent import statement for URLLibInstrumentor

* Correct code in example

* One last correction to doc to create instance
  • Loading branch information
BryanFauble authored and lmolkova committed Sep 14, 2024
1 parent be60fc3 commit c43972a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ The hooks can be configured as follows:

.. code:: python
from opentelemetry.instrumentation.urllib import URLLibInstrumentor
# `request_obj` is an instance of urllib.request.Request
def request_hook(span, request_obj):
pass
Expand All @@ -38,8 +40,8 @@ The hooks can be configured as follows:
def response_hook(span, request_obj, response)
pass
URLLibInstrumentor.instrument(
request_hook=request_hook, response_hook=response_hook)
URLLibInstrumentor().instrument(
request_hook=request_hook, response_hook=response_hook
)
Exclude lists
Expand Down

0 comments on commit c43972a

Please sign in to comment.