From 61db33c6124bf37fdc535e9fc4aae76e2b7ea461 Mon Sep 17 00:00:00 2001 From: tammy-baylis-swi Date: Wed, 8 May 2024 13:46:10 -0700 Subject: [PATCH] Revert "Debug lines" This reverts commit 92b15ac38e0d4eb34d007e16021163016fea0ad5. --- .../instrumentation/requests/__init__.py | 15 ------------- .../opentelemetry/instrumentation/_semconv.py | 21 ------------------- .../instrumentation/instrumentor.py | 5 ----- 3 files changed, 41 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py index eb546cb082..12797d6f5e 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py @@ -125,9 +125,6 @@ def _instrument( :code:`requests.session.Session.request` (this includes :code:`requests.get`, etc.).""" - print("!!! init.py _instrument with opt_in_mode:") - print("%s", sem_conv_opt_in_mode) - # Since # https://github.com/psf/requests/commit/d72d1162142d1bf8b1b5711c664fbbd674f349d1 # (v0.7.0, Oct 23, 2011), get, post, etc are implemented via request which @@ -212,9 +209,6 @@ def get_or_create_headers(): except ValueError: pass - print("!!! RequestsInstrumentor start_as_current_span with span_attributes:") - print("%s", span_attributes) - with tracer.start_as_current_span( span_name, kind=SpanKind.CLIENT, attributes=span_attributes ) as span, set_ip_on_next_http_connection(span): @@ -318,8 +312,6 @@ def get_or_create_headers(): if exception is not None: raise exception.with_traceback(exception.__traceback__) - print("Attributes updated: %s", span_attributes) - return result instrumented_send.opentelemetry_instrumentation_requests_applied = True @@ -384,16 +376,9 @@ def _instrument(self, **kwargs): ``excluded_urls``: A string containing a comma-delimited list of regexes used to exclude URLs from tracking """ - print("!!! RequestsInstrumentor _instrument with kwargs:") - print("%s", kwargs) - semconv_opt_in_mode = _OpenTelemetrySemanticConventionStability._get_opentelemetry_stability_opt_in_mode( _OpenTelemetryStabilitySignalType.HTTP, ) - - print("Then got semconv_opt_in_mode (no hyphen):") - print("%s", semconv_opt_in_mode) - schema_url = _get_schema_url(semconv_opt_in_mode) tracer_provider = kwargs.get("tracer_provider") tracer = get_tracer( diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py index 93ec8afdff..efe3c75f70 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py @@ -119,10 +119,6 @@ def _initialize(cls): # Users can pass in comma delimited string for opt-in options # Only values for http stability are supported for now opt_in = os.environ.get(OTEL_SEMCONV_STABILITY_OPT_IN, "") - - print("!!! SemconvStability._initialize") - print("Got opt_in from env var: %s", opt_in) - opt_in_list = [] if opt_in: opt_in_list = [s.strip() for s in opt_in.split(",")] @@ -134,9 +130,6 @@ def _initialize(cls): http_opt_in = _HTTPStabilityMode.HTTP_DUP elif _HTTPStabilityMode.HTTP.value in opt_in_list: http_opt_in = _HTTPStabilityMode.HTTP - - print("Using http_opt_in %s", http_opt_in) - _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING[ _OpenTelemetryStabilitySignalType.HTTP ] = http_opt_in @@ -148,16 +141,6 @@ def _get_opentelemetry_stability_opt_in_mode( cls, signal_type: _OpenTelemetryStabilitySignalType, ) -> _HTTPStabilityMode: - print("!!! _semconv.get_otel_stability") - print("signal_type: %s", signal_type) - print("_OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING: %s", _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING) - print( - "retval: %s", - _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING.get( - signal_type, _HTTPStabilityMode.DEFAULT - ) - ) - return _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING.get( signal_type, _HTTPStabilityMode.DEFAULT ) @@ -241,14 +224,10 @@ def _set_http_status_code(result, code, sem_conv_opt_in_mode): def _set_http_url(result, url, sem_conv_opt_in_mode): - print("!!! _semconv._set_http_url got opt_in_mode: %s", sem_conv_opt_in_mode) - if _report_old(sem_conv_opt_in_mode): set_string_attribute(result, SpanAttributes.HTTP_URL, url) - print("set_string_attr with key %s, url %s", SpanAttributes.HTTP_URL, url) if _report_new(sem_conv_opt_in_mode): set_string_attribute(result, SpanAttributes.URL_FULL, url) - print("set_string_attr with key %s, url %s", SpanAttributes.URL_FULL, url) def _set_http_scheme(result, scheme, sem_conv_opt_in_mode): diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py index 0699729f3c..c612bfeceb 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py @@ -96,9 +96,6 @@ def instrument(self, **kwargs): ``opentelemetry-instrument`` command does. """ - print("!!! Starting BaseInstrumentor.instrument with kwargs:") - print("%s", kwargs) - if self._is_instrumented_by_opentelemetry: _LOG.warning("Attempting to instrument while already instrumented") return None @@ -114,8 +111,6 @@ def instrument(self, **kwargs): # initialize semantic conventions opt-in if needed _OpenTelemetrySemanticConventionStability._initialize() - print("Base instrumentor calling self._instrument with kwargs:") - print("%s", kwargs) result = self._instrument( # pylint: disable=assignment-from-no-return **kwargs )