Skip to content

Commit

Permalink
Removed library specific keys and updated core repo SHA
Browse files Browse the repository at this point in the history
  • Loading branch information
carolabadeer committed Jun 2, 2022
1 parent 6558b1e commit 7d35f17
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'release/*'
pull_request:
env:
CORE_REPO_SHA: e4494ea9cdd420390a36f6e6bbd9f15cd29873e9
CORE_REPO_SHA: c82829283d3e99aa2e089d1774ee509619650617

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,16 @@ def response_hook(span, service_name, operation_name, result):
_SUPPRESS_INSTRUMENTATION_KEY,
unwrap,
)
from opentelemetry.context import (_SUPPRESS_HTTP_INSTRUMENTATION_KEY)
from opentelemetry.context import (
_SUPPRESS_HTTP_INSTRUMENTATION_KEY
)
from opentelemetry.propagate import inject
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import get_tracer
from opentelemetry.trace.span import Span

logger = logging.getLogger(__name__)

# A key to a context variable to avoid creating duplicate spans when instrumenting
# both botocore.client and urllib3.connectionpool.HTTPConnectionPool.urlopen since
# botocore calls urlopen

_BOTOCORE_INSTRUMENTATION_KEY = context_api.create_key(
"botocore_instrumentation"
)

# pylint: disable=unused-argument
def _patched_endpoint_prepare_request(wrapped, instance, args, kwargs):
request = args[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@
from opentelemetry.instrumentation.requests.version import __version__
from opentelemetry.instrumentation.utils import (
_SUPPRESS_INSTRUMENTATION_KEY,
#_SUPPRESS_HTTP_INSTRUMENTATION_KEY,
http_status_to_status_code,
)
from opentelemetry.context import (_SUPPRESS_HTTP_INSTRUMENTATION_KEY)
from opentelemetry.context import (
_SUPPRESS_HTTP_INSTRUMENTATION_KEY
)
from opentelemetry.propagate import inject
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import SpanKind, get_tracer
Expand All @@ -77,11 +78,6 @@
)
from opentelemetry.util.http.httplib import set_ip_on_next_http_connection

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

_excluded_urls_from_env = get_excluded_urls("REQUESTS")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,15 @@ def response_hook(span, request_obj, response)
_SUPPRESS_INSTRUMENTATION_KEY,
http_status_to_status_code,
)
from opentelemetry.context import _SUPPRESS_HTTP_INSTRUMENTATION_KEY
from opentelemetry.context import (
_SUPPRESS_HTTP_INSTRUMENTATION_KEY
)
from opentelemetry.propagate import inject
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import Span, SpanKind, get_tracer
from opentelemetry.trace.status import Status
from opentelemetry.util.http import remove_url_credentials

# A key to a context variable to avoid creating duplicate spans when instrumenting
# both, Session.request and Session.send, since Session.request calls into Session.send
_URLLIB_INSTRUMENTATION_KEY = context.create_key(
"urllib_instrumentation"
)
_RequestHookT = typing.Optional[typing.Callable[[Span, Request], None]]
_ResponseHookT = typing.Optional[
typing.Callable[[Span, Request, client.HTTPResponse], None]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,18 @@ def response_hook(span, request, response):
from opentelemetry.instrumentation.urllib3.version import __version__
from opentelemetry.instrumentation.utils import (
_SUPPRESS_INSTRUMENTATION_KEY,
# _SUPPRESS_HTTP_INSTRUMENTATION_KEY,
http_status_to_status_code,
unwrap,
)
from opentelemetry.context import (_SUPPRESS_HTTP_INSTRUMENTATION_KEY)

from opentelemetry.context import (
_SUPPRESS_HTTP_INSTRUMENTATION_KEY
)
from opentelemetry.propagate import inject
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import Span, SpanKind, get_tracer
from opentelemetry.trace.status import Status
from opentelemetry.util.http.httplib import set_ip_on_next_http_connection

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

_UrlFilterT = typing.Optional[typing.Callable[[str], str]]
_RequestHookT = typing.Optional[
Expand Down Expand Up @@ -147,7 +142,7 @@ def _instrument(self, **kwargs):
response_hook=kwargs.get("response_hook"),
url_filter=kwargs.get("url_filter"),
)

def _uninstrument(self, **kwargs):
_uninstrument()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@

from opentelemetry import context, trace
from opentelemetry.instrumentation.urllib3 import (
_SUPPRESS_HTTP_INSTRUMENTATION_KEY,
URLLib3Instrumentor,
)
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.context import (
_SUPPRESS_HTTP_INSTRUMENTATION_KEY
)
from opentelemetry.propagate import get_global_textmap, set_global_textmap
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.test.mock_textmap import MockTextMapPropagator
Expand Down

0 comments on commit 7d35f17

Please sign in to comment.