Skip to content
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

Azure.monitor.opentelemetry.exporter replace pkg_resources with importlib.metadata #30018

Merged
merged 4 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
import threading
import time

import pkg_resources
try:
from importlib.metadata import version
except ImportError:
# fallback for python 3.7
from importlib_metadata import version
lzchen marked this conversation as resolved.
Show resolved Hide resolved

from opentelemetry.semconv.resource import ResourceAttributes
from opentelemetry.sdk.util import ns_to_iso_str
Expand All @@ -19,9 +23,7 @@


# Workaround for missing version file
opentelemetry_version = pkg_resources.get_distribution(
"opentelemetry-sdk"
).version
opentelemetry_version = version("opentelemetry-sdk")


def _get_sdk_version_prefix():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"msrest>=0.6.10",
"opentelemetry-api==1.17.0",
"opentelemetry-sdk==1.17.0",
"importlib-metadata>=6.0.0; python_version < '3.8'"
],
entry_points={
"opentelemetry_traces_exporter": [
Expand Down
1 change: 1 addition & 0 deletions shared_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ azure-schemaregistry
avro
uamqp
yarl
importlib-metadata