From bed13f513645742f58c42003196c0ac934d8c773 Mon Sep 17 00:00:00 2001 From: BryanFauble <17128019+BryanFauble@users.noreply.github.com> Date: Fri, 13 Sep 2024 06:53:13 -0700 Subject: [PATCH] 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 --- .../opentelemetry-instrumentation-urllib/README.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-urllib/README.rst b/instrumentation/opentelemetry-instrumentation-urllib/README.rst index c78e092fb4..f673fb07f9 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/README.rst +++ b/instrumentation/opentelemetry-instrumentation-urllib/README.rst @@ -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 @@ -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