Open cforce opened 1 month ago
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 https://github.com/Azure-Samples/azure-search-openai-demo/pull/2083 This is only with the optional variable, right? Not with the default deployment?
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:
Only use autoinstrumentation on App Service if you aren't using manual instrumentation of OpenTelemetry in your code...
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)
https://github.com/Azure-Samples/azure-search-openai-demo/blob/e34edd561b575565e686aed7a0eb125ce8215a6d/app/backend/requirements.txt#L230
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 .