Skip to content

[Bug] opentelemetry-related errors for Linux Dedicated / Linux Consumption #1668

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

Closed
hallvictoria opened this issue Apr 17, 2025 · 1 comment

Comments

@hallvictoria
Copy link
Contributor

hallvictoria commented Apr 17, 2025

Background

Python Azure Function apps on runtime version 4.1038.400.2 on Linux Dedicated or Linux Consumption (not Flex Consumption) that include older versions of azure.core.*, opentelemetry-api, opentelemetry-sdk, or other packages that have these as dependencies may see opentelemetry-related errors during function indexing and function execution.

Examples of these errors include:

"ImportError: cannot import name '_OTEL_PYTHON_LOGGER_PROVIDER' from 'opentelemetry.environment_variables'" 

"ImportError: cannot import name '_OTEL_PYTHON_EVENT_LOGGER_PROVIDER' from 'opentelemetry.environment_variables'"

"ModuleNotFoundError: No module named 'azure.core.tracing.ext.opentelemetry_span'"

"ImportError: cannot import name 'DependencyConflictError' from 'opentelemetry.instrumentation.dependencies"

"ImportError: cannot import name 'Distribution' from 'opentelemetry.util._importlib_metadata'"

"ImportError: cannot import name 'PackageNotFoundError' from 'opentelemetry.util._importlib_metadata'"

"ImportError: cannot import name 'distributions' from 'opentelemetry.util._importlib_metadata'"

Root Cause

A new feature was planned to include OpenTelemetry support by default, so users wouldn’t need to manually add any OpenTelemetry-related packages to their application dependencies. To enable this, the azure-monitor-opentelemetry-exporter and azure-monitor-opentelemetry libraries were added to the Python 3.9–3.11 images.

These images include the latest versions of the libraries. However, if an app brings an older version of one of the dependencies of the AzMon distro, it will result in a dependency conflict.

Mitigations

  1. Update to opentelemetry-api>=1.28.0
  2. Pin to runtime version 4.1036 using LinuxFxVersion

Long-Term Solution

We are in the process of rolling out a fix for this issue, which will be in runtime version 4.1038.400.3. ETA for the fix is ~1 week. The team is investigating different options to provide support for this new feature without impacting existing apps.

@hallvictoria hallvictoria pinned this issue Apr 17, 2025
@hallvictoria
Copy link
Contributor Author

The fix has been rolled out to all impacted regions. If anyone is still facing this issue, please restart your function app and ensure the runtime version is >= 4.1038.400.3.

@hallvictoria hallvictoria unpinned this issue Apr 29, 2025
@hallvictoria hallvictoria pinned this issue May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant