Skip to content

Commit bed13f5

Browse files
authored
Add consistent import statement for URLLibInstrumentor (#2868)
* Add consistent import statement for URLLibInstrumentor * Correct code in example * One last correction to doc to create instance
1 parent d135f20 commit bed13f5

File tree

1 file changed

+4
-2
lines changed
  • instrumentation/opentelemetry-instrumentation-urllib

1 file changed

+4
-2
lines changed

instrumentation/opentelemetry-instrumentation-urllib/README.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ The hooks can be configured as follows:
2929

3030
.. code:: python
3131
32+
from opentelemetry.instrumentation.urllib import URLLibInstrumentor
33+
3234
# `request_obj` is an instance of urllib.request.Request
3335
def request_hook(span, request_obj):
3436
pass
@@ -38,8 +40,8 @@ The hooks can be configured as follows:
3840
def response_hook(span, request_obj, response)
3941
pass
4042
41-
URLLibInstrumentor.instrument(
42-
request_hook=request_hook, response_hook=response_hook)
43+
URLLibInstrumentor().instrument(
44+
request_hook=request_hook, response_hook=response_hook
4345
)
4446
4547
Exclude lists

0 commit comments

Comments
 (0)