Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7d35f17

Browse files
committedJun 2, 2022
Removed library specific keys and updated core repo SHA
1 parent 6558b1e commit 7d35f17

File tree

6 files changed

+17
-33
lines changed
  • .github/workflows
  • instrumentation
    • opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore
    • opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests
    • opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib
    • opentelemetry-instrumentation-urllib3

6 files changed

+17
-33
lines changed
 

Diff for: ‎.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'release/*'
77
pull_request:
88
env:
9-
CORE_REPO_SHA: e4494ea9cdd420390a36f6e6bbd9f15cd29873e9
9+
CORE_REPO_SHA: c82829283d3e99aa2e089d1774ee509619650617
1010

1111
jobs:
1212
build:

Diff for: ‎instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -98,22 +98,16 @@ def response_hook(span, service_name, operation_name, result):
9898
_SUPPRESS_INSTRUMENTATION_KEY,
9999
unwrap,
100100
)
101-
from opentelemetry.context import (_SUPPRESS_HTTP_INSTRUMENTATION_KEY)
101+
from opentelemetry.context import (
102+
_SUPPRESS_HTTP_INSTRUMENTATION_KEY
103+
)
102104
from opentelemetry.propagate import inject
103105
from opentelemetry.semconv.trace import SpanAttributes
104106
from opentelemetry.trace import get_tracer
105107
from opentelemetry.trace.span import Span
106108

107109
logger = logging.getLogger(__name__)
108110

109-
# A key to a context variable to avoid creating duplicate spans when instrumenting
110-
# both botocore.client and urllib3.connectionpool.HTTPConnectionPool.urlopen since
111-
# botocore calls urlopen
112-
113-
_BOTOCORE_INSTRUMENTATION_KEY = context_api.create_key(
114-
"botocore_instrumentation"
115-
)
116-
117111
# pylint: disable=unused-argument
118112
def _patched_endpoint_prepare_request(wrapped, instance, args, kwargs):
119113
request = args[0]

Diff for: ‎instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@
6262
from opentelemetry.instrumentation.requests.version import __version__
6363
from opentelemetry.instrumentation.utils import (
6464
_SUPPRESS_INSTRUMENTATION_KEY,
65-
#_SUPPRESS_HTTP_INSTRUMENTATION_KEY,
6665
http_status_to_status_code,
6766
)
68-
from opentelemetry.context import (_SUPPRESS_HTTP_INSTRUMENTATION_KEY)
67+
from opentelemetry.context import (
68+
_SUPPRESS_HTTP_INSTRUMENTATION_KEY
69+
)
6970
from opentelemetry.propagate import inject
7071
from opentelemetry.semconv.trace import SpanAttributes
7172
from opentelemetry.trace import SpanKind, get_tracer
@@ -77,11 +78,6 @@
7778
)
7879
from opentelemetry.util.http.httplib import set_ip_on_next_http_connection
7980

80-
# A key to a context variable to avoid creating duplicate spans when instrumenting
81-
# both, Session.request and Session.send, since Session.request calls into Session.send
82-
_REQUESTS_INSTRUMENTATION_KEY = context.create_key(
83-
"requests_instrumentation"
84-
)
8581

8682
_excluded_urls_from_env = get_excluded_urls("REQUESTS")
8783

Diff for: ‎instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,15 @@ def response_hook(span, request_obj, response)
8282
_SUPPRESS_INSTRUMENTATION_KEY,
8383
http_status_to_status_code,
8484
)
85-
from opentelemetry.context import _SUPPRESS_HTTP_INSTRUMENTATION_KEY
85+
from opentelemetry.context import (
86+
_SUPPRESS_HTTP_INSTRUMENTATION_KEY
87+
)
8688
from opentelemetry.propagate import inject
8789
from opentelemetry.semconv.trace import SpanAttributes
8890
from opentelemetry.trace import Span, SpanKind, get_tracer
8991
from opentelemetry.trace.status import Status
9092
from opentelemetry.util.http import remove_url_credentials
9193

92-
# A key to a context variable to avoid creating duplicate spans when instrumenting
93-
# both, Session.request and Session.send, since Session.request calls into Session.send
94-
_URLLIB_INSTRUMENTATION_KEY = context.create_key(
95-
"urllib_instrumentation"
96-
)
9794
_RequestHookT = typing.Optional[typing.Callable[[Span, Request], None]]
9895
_ResponseHookT = typing.Optional[
9996
typing.Callable[[Span, Request, client.HTTPResponse], None]

Diff for: ‎instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py

+4-9
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,18 @@ def response_hook(span, request, response):
7777
from opentelemetry.instrumentation.urllib3.version import __version__
7878
from opentelemetry.instrumentation.utils import (
7979
_SUPPRESS_INSTRUMENTATION_KEY,
80-
# _SUPPRESS_HTTP_INSTRUMENTATION_KEY,
8180
http_status_to_status_code,
8281
unwrap,
8382
)
84-
from opentelemetry.context import (_SUPPRESS_HTTP_INSTRUMENTATION_KEY)
85-
83+
from opentelemetry.context import (
84+
_SUPPRESS_HTTP_INSTRUMENTATION_KEY
85+
)
8686
from opentelemetry.propagate import inject
8787
from opentelemetry.semconv.trace import SpanAttributes
8888
from opentelemetry.trace import Span, SpanKind, get_tracer
8989
from opentelemetry.trace.status import Status
9090
from opentelemetry.util.http.httplib import set_ip_on_next_http_connection
9191

92-
# A key to a context variable to avoid creating duplicate spans when instrumenting
93-
# both, Session.request and Session.send, since Session.request calls into Session.send
94-
_URLLIB3_INSTRUMENTATION_KEY = context.create_key(
95-
"urllib3_instrumentation"
96-
)
9792

9893
_UrlFilterT = typing.Optional[typing.Callable[[str], str]]
9994
_RequestHookT = typing.Optional[
@@ -147,7 +142,7 @@ def _instrument(self, **kwargs):
147142
response_hook=kwargs.get("response_hook"),
148143
url_filter=kwargs.get("url_filter"),
149144
)
150-
145+
151146
def _uninstrument(self, **kwargs):
152147
_uninstrument()
153148

Diff for: ‎instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121

2222
from opentelemetry import context, trace
2323
from opentelemetry.instrumentation.urllib3 import (
24-
_SUPPRESS_HTTP_INSTRUMENTATION_KEY,
2524
URLLib3Instrumentor,
2625
)
2726
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
27+
from opentelemetry.context import (
28+
_SUPPRESS_HTTP_INSTRUMENTATION_KEY
29+
)
2830
from opentelemetry.propagate import get_global_textmap, set_global_textmap
2931
from opentelemetry.semconv.trace import SpanAttributes
3032
from opentelemetry.test.mock_textmap import MockTextMapPropagator

0 commit comments

Comments
 (0)
Please sign in to comment.