Skip to content

Commit

Permalink
revert requests change
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Xue committed Jun 1, 2020
1 parent eecd953 commit 4b5d631
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@
from opentelemetry.trace import SpanKind
from opentelemetry.trace.status import Status, StatusCanonicalCode

# StackDriver exporter spins up a new thread (that doesn't inherit the
# "suppress_instrumentation" context) that makes a request call. We need to
# manually blacklist the url to avoid falling into an infinite loop.
# https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/issues/3
SUPPRESSION_BLACKLIST = ["https://oauth2.googleapis.com/token"]


# pylint: disable=unused-argument
def _instrument(tracer_provider=None, span_callback=None):
Expand All @@ -79,10 +73,7 @@ def _instrument(tracer_provider=None, span_callback=None):

@functools.wraps(wrapped)
def instrumented_request(self, method, url, *args, **kwargs):
if (
context.get_value("suppress_instrumentation")
or url in SUPPRESSION_BLACKLIST
):
if context.get_value("suppress_instrumentation"):
return wrapped(self, method, url, *args, **kwargs)

# See
Expand Down

0 comments on commit 4b5d631

Please sign in to comment.