-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: cannot import name '_set_http_host' from 'opentelemetry.instrumentation._semconv' #2099
Comments
I disabled AppInsighs and restarted the server and now it works again. |
I saw that as well, and I've reported it to the App Service team. That's why I have not yet merged #2083 |
I have manually activated in Portal, which is the same result as if I would use.enabled in bicep I assume |
Okay, thanks for clarifying, I've reached out again to the App Service team. |
Yes, disabling autoinstrumentation in the portal is the correct response. It is causing a dependency conflict with the Manual Instrumentation built into this app. This AI demo includes "azure-monitor-opentelemetry==1.6.1" and enables "Manual instrumentation" with this distro here so long as you set the APPLICATIONINSIGHTS_CONNECTION_STRING. You should only use Manual Instrumentation or Autoinstrumentation, but not both. See this note in our documentation: Since this test app already uses manual instrumentation, I recommend that anyone who has this issue disable autoinstrumentation. You can do this in the "Application Insights" blade of App Service (or, if you enabled this feature in an ARM template, make sure ApplicationInsightsAgent_EXTENSION_VERSION is set to "disabled"). |
Since i switched on app insight opentelemetry dependency incompatibilities fights back. I still don't have an explanation as version
opentelemetry-instrumentation==0.47b0 used in requirements.txt definitely has a method "set_http_host"
ImportError: cannot import name '_set_http_host' from 'opentelemetry.instrumentation._semconv' (/agents/python/opentelemetry/instrumentation/_semconv.py)
azure-search-openai-demo/app/backend/requirements.txt
Line 230 in e34edd5
https://github.com/open-telemetry/opentelemetry-python-contrib/blob/07c3324a3bcf80ee716f90b2456f59af08b685fa/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py#L329
The import is used at app.py:35
"from opentelemetry.instrumentation.httpx import (
HTTPXClientInstrumentor,
)
What makes me curios is
ImportError: cannot import name '_set_http_host' from 'opentelemetry.instrumentation._semconv' (/agents/python/opentelemetry/instrumentation/_semconv.py)
It looks like it tries to load the module froma by Azure at runtime injected pypath which is set by an Agent. So this agnet my not use at all the proper version opentelemetry-instrumentation==0.47b0 .
The text was updated successfully, but these errors were encountered: