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 47ed46d175..eb546cb082 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py @@ -125,6 +125,9 @@ 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 @@ -381,9 +384,16 @@ 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 a7221ccb99..dd1df59728 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py @@ -141,6 +141,16 @@ 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 ) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py index c612bfeceb..0699729f3c 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py @@ -96,6 +96,9 @@ 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 @@ -111,6 +114,8 @@ 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 )