opentelemetry-instrumentation 0.56b0__py3-none-any.whl → 0.57b0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opentelemetry/instrumentation/auto_instrumentation/_load.py +48 -5
- opentelemetry/instrumentation/bootstrap_gen.py +54 -54
- opentelemetry/instrumentation/dependencies.py +114 -3
- opentelemetry/instrumentation/version.py +1 -1
- {opentelemetry_instrumentation-0.56b0.dist-info → opentelemetry_instrumentation-0.57b0.dist-info}/METADATA +2 -2
- {opentelemetry_instrumentation-0.56b0.dist-info → opentelemetry_instrumentation-0.57b0.dist-info}/RECORD +9 -9
- {opentelemetry_instrumentation-0.56b0.dist-info → opentelemetry_instrumentation-0.57b0.dist-info}/WHEEL +0 -0
- {opentelemetry_instrumentation-0.56b0.dist-info → opentelemetry_instrumentation-0.57b0.dist-info}/entry_points.txt +0 -0
- {opentelemetry_instrumentation-0.56b0.dist-info → opentelemetry_instrumentation-0.57b0.dist-info}/licenses/LICENSE +0 -0
@@ -12,10 +12,14 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
from functools import cached_property
|
15
16
|
from logging import getLogger
|
16
17
|
from os import environ
|
17
18
|
|
18
|
-
from opentelemetry.instrumentation.dependencies import
|
19
|
+
from opentelemetry.instrumentation.dependencies import (
|
20
|
+
DependencyConflictError,
|
21
|
+
get_dist_dependency_conflicts,
|
22
|
+
)
|
19
23
|
from opentelemetry.instrumentation.distro import BaseDistro, DefaultDistro
|
20
24
|
from opentelemetry.instrumentation.environment_variables import (
|
21
25
|
OTEL_PYTHON_CONFIGURATOR,
|
@@ -23,11 +27,36 @@ from opentelemetry.instrumentation.environment_variables import (
|
|
23
27
|
OTEL_PYTHON_DISTRO,
|
24
28
|
)
|
25
29
|
from opentelemetry.instrumentation.version import __version__
|
26
|
-
from opentelemetry.util._importlib_metadata import
|
30
|
+
from opentelemetry.util._importlib_metadata import (
|
31
|
+
EntryPoint,
|
32
|
+
distributions,
|
33
|
+
entry_points,
|
34
|
+
)
|
27
35
|
|
28
36
|
_logger = getLogger(__name__)
|
29
37
|
|
30
38
|
|
39
|
+
class _EntryPointDistFinder:
|
40
|
+
@cached_property
|
41
|
+
def _mapping(self):
|
42
|
+
return {
|
43
|
+
self._key_for(ep): dist
|
44
|
+
for dist in distributions()
|
45
|
+
for ep in dist.entry_points
|
46
|
+
}
|
47
|
+
|
48
|
+
def dist_for(self, entry_point: EntryPoint):
|
49
|
+
dist = getattr(entry_point, "dist", None)
|
50
|
+
if dist:
|
51
|
+
return dist
|
52
|
+
|
53
|
+
return self._mapping.get(self._key_for(entry_point))
|
54
|
+
|
55
|
+
@staticmethod
|
56
|
+
def _key_for(entry_point: EntryPoint):
|
57
|
+
return f"{entry_point.group}:{entry_point.name}:{entry_point.value}"
|
58
|
+
|
59
|
+
|
31
60
|
def _load_distro() -> BaseDistro:
|
32
61
|
distro_name = environ.get(OTEL_PYTHON_DISTRO, None)
|
33
62
|
for entry_point in entry_points(group="opentelemetry_distro"):
|
@@ -55,6 +84,7 @@ def _load_distro() -> BaseDistro:
|
|
55
84
|
|
56
85
|
def _load_instrumentors(distro):
|
57
86
|
package_to_exclude = environ.get(OTEL_PYTHON_DISABLED_INSTRUMENTATIONS, [])
|
87
|
+
entry_point_finder = _EntryPointDistFinder()
|
58
88
|
if isinstance(package_to_exclude, str):
|
59
89
|
package_to_exclude = package_to_exclude.split(",")
|
60
90
|
# to handle users entering "requests , flask" or "requests, flask" with spaces
|
@@ -71,11 +101,24 @@ def _load_instrumentors(distro):
|
|
71
101
|
continue
|
72
102
|
|
73
103
|
try:
|
74
|
-
|
75
|
-
|
76
|
-
|
104
|
+
entry_point_dist = entry_point_finder.dist_for(entry_point)
|
105
|
+
conflict = get_dist_dependency_conflicts(entry_point_dist)
|
106
|
+
if conflict:
|
107
|
+
_logger.debug(
|
108
|
+
"Skipping instrumentation %s: %s",
|
109
|
+
entry_point.name,
|
110
|
+
conflict,
|
111
|
+
)
|
112
|
+
continue
|
113
|
+
|
114
|
+
# tell instrumentation to not run dep checks again as we already did it above
|
115
|
+
distro.load_instrumentor(entry_point, skip_dep_check=True)
|
77
116
|
_logger.debug("Instrumented %s", entry_point.name)
|
78
117
|
except DependencyConflictError as exc:
|
118
|
+
# Dependency conflicts are generally caught from get_dist_dependency_conflicts
|
119
|
+
# returning a DependencyConflict. Keeping this error handling in case custom
|
120
|
+
# distro and instrumentor behavior raises a DependencyConflictError later.
|
121
|
+
# See https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3610
|
79
122
|
_logger.debug(
|
80
123
|
"Skipping instrumentation %s: %s",
|
81
124
|
entry_point.name,
|
@@ -26,199 +26,199 @@ libraries = [
|
|
26
26
|
},
|
27
27
|
{
|
28
28
|
"library": "aio_pika >= 7.2.0, < 10.0.0",
|
29
|
-
"instrumentation": "opentelemetry-instrumentation-aio-pika==0.
|
29
|
+
"instrumentation": "opentelemetry-instrumentation-aio-pika==0.57b0",
|
30
30
|
},
|
31
31
|
{
|
32
32
|
"library": "aiohttp ~= 3.0",
|
33
|
-
"instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.
|
33
|
+
"instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.57b0",
|
34
34
|
},
|
35
35
|
{
|
36
36
|
"library": "aiohttp ~= 3.0",
|
37
|
-
"instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.
|
37
|
+
"instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.57b0",
|
38
38
|
},
|
39
39
|
{
|
40
40
|
"library": "aiokafka >= 0.8, < 1.0",
|
41
|
-
"instrumentation": "opentelemetry-instrumentation-aiokafka==0.
|
41
|
+
"instrumentation": "opentelemetry-instrumentation-aiokafka==0.57b0",
|
42
42
|
},
|
43
43
|
{
|
44
44
|
"library": "aiopg >= 0.13.0, < 2.0.0",
|
45
|
-
"instrumentation": "opentelemetry-instrumentation-aiopg==0.
|
45
|
+
"instrumentation": "opentelemetry-instrumentation-aiopg==0.57b0",
|
46
46
|
},
|
47
47
|
{
|
48
48
|
"library": "asgiref ~= 3.0",
|
49
|
-
"instrumentation": "opentelemetry-instrumentation-asgi==0.
|
49
|
+
"instrumentation": "opentelemetry-instrumentation-asgi==0.57b0",
|
50
50
|
},
|
51
51
|
{
|
52
52
|
"library": "asyncclick ~= 8.0",
|
53
|
-
"instrumentation": "opentelemetry-instrumentation-asyncclick==0.
|
53
|
+
"instrumentation": "opentelemetry-instrumentation-asyncclick==0.57b0",
|
54
54
|
},
|
55
55
|
{
|
56
56
|
"library": "asyncpg >= 0.12.0",
|
57
|
-
"instrumentation": "opentelemetry-instrumentation-asyncpg==0.
|
57
|
+
"instrumentation": "opentelemetry-instrumentation-asyncpg==0.57b0",
|
58
58
|
},
|
59
59
|
{
|
60
60
|
"library": "boto~=2.0",
|
61
|
-
"instrumentation": "opentelemetry-instrumentation-boto==0.
|
61
|
+
"instrumentation": "opentelemetry-instrumentation-boto==0.57b0",
|
62
62
|
},
|
63
63
|
{
|
64
64
|
"library": "boto3 ~= 1.0",
|
65
|
-
"instrumentation": "opentelemetry-instrumentation-boto3sqs==0.
|
65
|
+
"instrumentation": "opentelemetry-instrumentation-boto3sqs==0.57b0",
|
66
66
|
},
|
67
67
|
{
|
68
68
|
"library": "botocore ~= 1.0",
|
69
|
-
"instrumentation": "opentelemetry-instrumentation-botocore==0.
|
69
|
+
"instrumentation": "opentelemetry-instrumentation-botocore==0.57b0",
|
70
70
|
},
|
71
71
|
{
|
72
72
|
"library": "cassandra-driver ~= 3.25",
|
73
|
-
"instrumentation": "opentelemetry-instrumentation-cassandra==0.
|
73
|
+
"instrumentation": "opentelemetry-instrumentation-cassandra==0.57b0",
|
74
74
|
},
|
75
75
|
{
|
76
76
|
"library": "scylla-driver ~= 3.25",
|
77
|
-
"instrumentation": "opentelemetry-instrumentation-cassandra==0.
|
77
|
+
"instrumentation": "opentelemetry-instrumentation-cassandra==0.57b0",
|
78
78
|
},
|
79
79
|
{
|
80
80
|
"library": "celery >= 4.0, < 6.0",
|
81
|
-
"instrumentation": "opentelemetry-instrumentation-celery==0.
|
81
|
+
"instrumentation": "opentelemetry-instrumentation-celery==0.57b0",
|
82
82
|
},
|
83
83
|
{
|
84
84
|
"library": "click >= 8.1.3, < 9.0.0",
|
85
|
-
"instrumentation": "opentelemetry-instrumentation-click==0.
|
85
|
+
"instrumentation": "opentelemetry-instrumentation-click==0.57b0",
|
86
86
|
},
|
87
87
|
{
|
88
88
|
"library": "confluent-kafka >= 1.8.2, <= 2.7.0",
|
89
|
-
"instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.
|
89
|
+
"instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.57b0",
|
90
90
|
},
|
91
91
|
{
|
92
92
|
"library": "django >= 1.10",
|
93
|
-
"instrumentation": "opentelemetry-instrumentation-django==0.
|
93
|
+
"instrumentation": "opentelemetry-instrumentation-django==0.57b0",
|
94
94
|
},
|
95
95
|
{
|
96
96
|
"library": "elasticsearch >= 6.0",
|
97
|
-
"instrumentation": "opentelemetry-instrumentation-elasticsearch==0.
|
97
|
+
"instrumentation": "opentelemetry-instrumentation-elasticsearch==0.57b0",
|
98
98
|
},
|
99
99
|
{
|
100
100
|
"library": "falcon >= 1.4.1, < 5.0.0",
|
101
|
-
"instrumentation": "opentelemetry-instrumentation-falcon==0.
|
101
|
+
"instrumentation": "opentelemetry-instrumentation-falcon==0.57b0",
|
102
102
|
},
|
103
103
|
{
|
104
104
|
"library": "fastapi ~= 0.92",
|
105
|
-
"instrumentation": "opentelemetry-instrumentation-fastapi==0.
|
105
|
+
"instrumentation": "opentelemetry-instrumentation-fastapi==0.57b0",
|
106
106
|
},
|
107
107
|
{
|
108
108
|
"library": "flask >= 1.0",
|
109
|
-
"instrumentation": "opentelemetry-instrumentation-flask==0.
|
109
|
+
"instrumentation": "opentelemetry-instrumentation-flask==0.57b0",
|
110
110
|
},
|
111
111
|
{
|
112
112
|
"library": "grpcio >= 1.42.0",
|
113
|
-
"instrumentation": "opentelemetry-instrumentation-grpc==0.
|
113
|
+
"instrumentation": "opentelemetry-instrumentation-grpc==0.57b0",
|
114
114
|
},
|
115
115
|
{
|
116
116
|
"library": "httpx >= 0.18.0",
|
117
|
-
"instrumentation": "opentelemetry-instrumentation-httpx==0.
|
117
|
+
"instrumentation": "opentelemetry-instrumentation-httpx==0.57b0",
|
118
118
|
},
|
119
119
|
{
|
120
120
|
"library": "jinja2 >= 2.7, < 4.0",
|
121
|
-
"instrumentation": "opentelemetry-instrumentation-jinja2==0.
|
121
|
+
"instrumentation": "opentelemetry-instrumentation-jinja2==0.57b0",
|
122
122
|
},
|
123
123
|
{
|
124
124
|
"library": "kafka-python >= 2.0, < 3.0",
|
125
|
-
"instrumentation": "opentelemetry-instrumentation-kafka-python==0.
|
125
|
+
"instrumentation": "opentelemetry-instrumentation-kafka-python==0.57b0",
|
126
126
|
},
|
127
127
|
{
|
128
128
|
"library": "kafka-python-ng >= 2.0, < 3.0",
|
129
|
-
"instrumentation": "opentelemetry-instrumentation-kafka-python==0.
|
129
|
+
"instrumentation": "opentelemetry-instrumentation-kafka-python==0.57b0",
|
130
130
|
},
|
131
131
|
{
|
132
132
|
"library": "mysql-connector-python >= 8.0, < 10.0",
|
133
|
-
"instrumentation": "opentelemetry-instrumentation-mysql==0.
|
133
|
+
"instrumentation": "opentelemetry-instrumentation-mysql==0.57b0",
|
134
134
|
},
|
135
135
|
{
|
136
136
|
"library": "mysqlclient < 3",
|
137
|
-
"instrumentation": "opentelemetry-instrumentation-mysqlclient==0.
|
137
|
+
"instrumentation": "opentelemetry-instrumentation-mysqlclient==0.57b0",
|
138
138
|
},
|
139
139
|
{
|
140
140
|
"library": "pika >= 0.12.0",
|
141
|
-
"instrumentation": "opentelemetry-instrumentation-pika==0.
|
141
|
+
"instrumentation": "opentelemetry-instrumentation-pika==0.57b0",
|
142
142
|
},
|
143
143
|
{
|
144
144
|
"library": "psycopg >= 3.1.0",
|
145
|
-
"instrumentation": "opentelemetry-instrumentation-psycopg==0.
|
145
|
+
"instrumentation": "opentelemetry-instrumentation-psycopg==0.57b0",
|
146
146
|
},
|
147
147
|
{
|
148
148
|
"library": "psycopg2 >= 2.7.3.1",
|
149
|
-
"instrumentation": "opentelemetry-instrumentation-psycopg2==0.
|
149
|
+
"instrumentation": "opentelemetry-instrumentation-psycopg2==0.57b0",
|
150
150
|
},
|
151
151
|
{
|
152
152
|
"library": "psycopg2-binary >= 2.7.3.1",
|
153
|
-
"instrumentation": "opentelemetry-instrumentation-psycopg2==0.
|
153
|
+
"instrumentation": "opentelemetry-instrumentation-psycopg2==0.57b0",
|
154
154
|
},
|
155
155
|
{
|
156
156
|
"library": "pymemcache >= 1.3.5, < 5",
|
157
|
-
"instrumentation": "opentelemetry-instrumentation-pymemcache==0.
|
157
|
+
"instrumentation": "opentelemetry-instrumentation-pymemcache==0.57b0",
|
158
158
|
},
|
159
159
|
{
|
160
160
|
"library": "pymongo >= 3.1, < 5.0",
|
161
|
-
"instrumentation": "opentelemetry-instrumentation-pymongo==0.
|
161
|
+
"instrumentation": "opentelemetry-instrumentation-pymongo==0.57b0",
|
162
162
|
},
|
163
163
|
{
|
164
164
|
"library": "pymssql >= 2.1.5, < 3",
|
165
|
-
"instrumentation": "opentelemetry-instrumentation-pymssql==0.
|
165
|
+
"instrumentation": "opentelemetry-instrumentation-pymssql==0.57b0",
|
166
166
|
},
|
167
167
|
{
|
168
168
|
"library": "PyMySQL < 2",
|
169
|
-
"instrumentation": "opentelemetry-instrumentation-pymysql==0.
|
169
|
+
"instrumentation": "opentelemetry-instrumentation-pymysql==0.57b0",
|
170
170
|
},
|
171
171
|
{
|
172
172
|
"library": "pyramid >= 1.7",
|
173
|
-
"instrumentation": "opentelemetry-instrumentation-pyramid==0.
|
173
|
+
"instrumentation": "opentelemetry-instrumentation-pyramid==0.57b0",
|
174
174
|
},
|
175
175
|
{
|
176
176
|
"library": "redis >= 2.6",
|
177
|
-
"instrumentation": "opentelemetry-instrumentation-redis==0.
|
177
|
+
"instrumentation": "opentelemetry-instrumentation-redis==0.57b0",
|
178
178
|
},
|
179
179
|
{
|
180
180
|
"library": "remoulade >= 0.50",
|
181
|
-
"instrumentation": "opentelemetry-instrumentation-remoulade==0.
|
181
|
+
"instrumentation": "opentelemetry-instrumentation-remoulade==0.57b0",
|
182
182
|
},
|
183
183
|
{
|
184
184
|
"library": "requests ~= 2.0",
|
185
|
-
"instrumentation": "opentelemetry-instrumentation-requests==0.
|
185
|
+
"instrumentation": "opentelemetry-instrumentation-requests==0.57b0",
|
186
186
|
},
|
187
187
|
{
|
188
188
|
"library": "sqlalchemy >= 1.0.0, < 2.1.0",
|
189
|
-
"instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.
|
189
|
+
"instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.57b0",
|
190
190
|
},
|
191
191
|
{
|
192
192
|
"library": "starlette >= 0.13",
|
193
|
-
"instrumentation": "opentelemetry-instrumentation-starlette==0.
|
193
|
+
"instrumentation": "opentelemetry-instrumentation-starlette==0.57b0",
|
194
194
|
},
|
195
195
|
{
|
196
196
|
"library": "psutil >= 5",
|
197
|
-
"instrumentation": "opentelemetry-instrumentation-system-metrics==0.
|
197
|
+
"instrumentation": "opentelemetry-instrumentation-system-metrics==0.57b0",
|
198
198
|
},
|
199
199
|
{
|
200
200
|
"library": "tornado >= 5.1.1",
|
201
|
-
"instrumentation": "opentelemetry-instrumentation-tornado==0.
|
201
|
+
"instrumentation": "opentelemetry-instrumentation-tornado==0.57b0",
|
202
202
|
},
|
203
203
|
{
|
204
204
|
"library": "tortoise-orm >= 0.17.0",
|
205
|
-
"instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.
|
205
|
+
"instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.57b0",
|
206
206
|
},
|
207
207
|
{
|
208
208
|
"library": "pydantic >= 1.10.2",
|
209
|
-
"instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.
|
209
|
+
"instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.57b0",
|
210
210
|
},
|
211
211
|
{
|
212
212
|
"library": "urllib3 >= 1.0.0, < 3.0.0",
|
213
|
-
"instrumentation": "opentelemetry-instrumentation-urllib3==0.
|
213
|
+
"instrumentation": "opentelemetry-instrumentation-urllib3==0.57b0",
|
214
214
|
},
|
215
215
|
]
|
216
216
|
default_instrumentations = [
|
217
|
-
"opentelemetry-instrumentation-asyncio==0.
|
218
|
-
"opentelemetry-instrumentation-dbapi==0.
|
219
|
-
"opentelemetry-instrumentation-logging==0.
|
220
|
-
"opentelemetry-instrumentation-sqlite3==0.
|
221
|
-
"opentelemetry-instrumentation-threading==0.
|
222
|
-
"opentelemetry-instrumentation-urllib==0.
|
223
|
-
"opentelemetry-instrumentation-wsgi==0.
|
217
|
+
"opentelemetry-instrumentation-asyncio==0.57b0",
|
218
|
+
"opentelemetry-instrumentation-dbapi==0.57b0",
|
219
|
+
"opentelemetry-instrumentation-logging==0.57b0",
|
220
|
+
"opentelemetry-instrumentation-sqlite3==0.57b0",
|
221
|
+
"opentelemetry-instrumentation-threading==0.57b0",
|
222
|
+
"opentelemetry-instrumentation-urllib==0.57b0",
|
223
|
+
"opentelemetry-instrumentation-wsgi==0.57b0",
|
224
224
|
]
|
@@ -20,6 +20,7 @@ from typing import Collection
|
|
20
20
|
from packaging.requirements import InvalidRequirement, Requirement
|
21
21
|
|
22
22
|
from opentelemetry.util._importlib_metadata import (
|
23
|
+
Distribution,
|
23
24
|
PackageNotFoundError,
|
24
25
|
version,
|
25
26
|
)
|
@@ -28,14 +29,44 @@ logger = getLogger(__name__)
|
|
28
29
|
|
29
30
|
|
30
31
|
class DependencyConflict:
|
32
|
+
"""Represents a dependency conflict in OpenTelemetry instrumentation.
|
33
|
+
|
34
|
+
This class is used to track conflicts between required dependencies and the
|
35
|
+
actual installed packages. It supports two scenarios:
|
36
|
+
|
37
|
+
1. Standard conflicts where all dependencies are required
|
38
|
+
2. Either/or conflicts where only one of a set of dependencies is required
|
39
|
+
|
40
|
+
Attributes:
|
41
|
+
required: The required dependency specification that conflicts with what's installed.
|
42
|
+
found: The actual dependency that was found installed (if any).
|
43
|
+
required_any: Collection of dependency specifications where any one would satisfy
|
44
|
+
the requirement (for either/or scenarios).
|
45
|
+
found_any: Collection of actual dependencies found for either/or scenarios.
|
46
|
+
"""
|
47
|
+
|
31
48
|
required: str | None = None
|
32
49
|
found: str | None = None
|
33
|
-
|
34
|
-
|
50
|
+
# The following fields are used when an instrumentation requires any of a set of dependencies rather than all.
|
51
|
+
required_any: Collection[str] = None
|
52
|
+
found_any: Collection[str] = None
|
53
|
+
|
54
|
+
def __init__(
|
55
|
+
self,
|
56
|
+
required: str | None = None,
|
57
|
+
found: str | None = None,
|
58
|
+
required_any: Collection[str] = None,
|
59
|
+
found_any: Collection[str] = None,
|
60
|
+
):
|
35
61
|
self.required = required
|
36
62
|
self.found = found
|
63
|
+
# The following fields are used when an instrumentation requires any of a set of dependencies rather than all.
|
64
|
+
self.required_any = required_any
|
65
|
+
self.found_any = found_any
|
37
66
|
|
38
67
|
def __str__(self):
|
68
|
+
if not self.required and (self.required_any or self.found_any):
|
69
|
+
return f'DependencyConflict: requested any of the following: "{self.required_any}" but found: "{self.found_any}"'
|
39
70
|
return f'DependencyConflict: requested: "{self.required}" but found: "{self.found}"'
|
40
71
|
|
41
72
|
|
@@ -49,8 +80,39 @@ class DependencyConflictError(Exception):
|
|
49
80
|
return str(self.conflict)
|
50
81
|
|
51
82
|
|
83
|
+
def get_dist_dependency_conflicts(
|
84
|
+
dist: Distribution,
|
85
|
+
) -> DependencyConflict | None:
|
86
|
+
instrumentation_deps = []
|
87
|
+
instrumentation_any_deps = []
|
88
|
+
extra = "extra"
|
89
|
+
instruments = "instruments"
|
90
|
+
instruments_marker = {extra: instruments}
|
91
|
+
instruments_any = "instruments-any"
|
92
|
+
instruments_any_marker = {extra: instruments_any}
|
93
|
+
if dist.requires:
|
94
|
+
for dep in dist.requires:
|
95
|
+
if extra not in dep:
|
96
|
+
continue
|
97
|
+
if instruments not in dep and instruments_any not in dep:
|
98
|
+
continue
|
99
|
+
|
100
|
+
req = Requirement(dep)
|
101
|
+
if req.marker.evaluate(instruments_marker): # type: ignore
|
102
|
+
instrumentation_deps.append(req) # type: ignore
|
103
|
+
if req.marker.evaluate(instruments_any_marker): # type: ignore
|
104
|
+
instrumentation_any_deps.append(req) # type: ignore
|
105
|
+
return get_dependency_conflicts(
|
106
|
+
instrumentation_deps, instrumentation_any_deps
|
107
|
+
) # type: ignore
|
108
|
+
|
109
|
+
|
52
110
|
def get_dependency_conflicts(
|
53
|
-
deps: Collection[
|
111
|
+
deps: Collection[
|
112
|
+
str | Requirement
|
113
|
+
], # Dependencies all of which are required
|
114
|
+
deps_any: Collection[str | Requirement]
|
115
|
+
| None = None, # Dependencies any of which are required
|
54
116
|
) -> DependencyConflict | None:
|
55
117
|
for dep in deps:
|
56
118
|
if isinstance(dep, Requirement):
|
@@ -73,4 +135,53 @@ def get_dependency_conflicts(
|
|
73
135
|
|
74
136
|
if not req.specifier.contains(dist_version):
|
75
137
|
return DependencyConflict(dep, f"{req.name} {dist_version}")
|
138
|
+
|
139
|
+
# If all the dependencies in "instruments" are present, check "instruments-any" for conflicts.
|
140
|
+
if deps_any:
|
141
|
+
return _get_dependency_conflicts_any(deps_any)
|
142
|
+
return None
|
143
|
+
|
144
|
+
|
145
|
+
# This is a helper functions designed to ease reading and meet linting requirements.
|
146
|
+
def _get_dependency_conflicts_any(
|
147
|
+
deps_any: Collection[str | Requirement],
|
148
|
+
) -> DependencyConflict | None:
|
149
|
+
if not deps_any:
|
150
|
+
return None
|
151
|
+
is_dependency_conflict = True
|
152
|
+
required_any: Collection[str] = []
|
153
|
+
found_any: Collection[str] = []
|
154
|
+
for dep in deps_any:
|
155
|
+
if isinstance(dep, Requirement):
|
156
|
+
req = dep
|
157
|
+
else:
|
158
|
+
try:
|
159
|
+
req = Requirement(dep)
|
160
|
+
except InvalidRequirement as exc:
|
161
|
+
logger.warning(
|
162
|
+
'error parsing dependency, reporting as a conflict: "%s" - %s',
|
163
|
+
dep,
|
164
|
+
exc,
|
165
|
+
)
|
166
|
+
return DependencyConflict(dep)
|
167
|
+
|
168
|
+
try:
|
169
|
+
dist_version = version(req.name)
|
170
|
+
except PackageNotFoundError:
|
171
|
+
required_any.append(str(dep))
|
172
|
+
continue
|
173
|
+
|
174
|
+
if req.specifier.contains(dist_version):
|
175
|
+
# Since only one of the instrumentation_any dependencies is required, there is no dependency conflict.
|
176
|
+
is_dependency_conflict = False
|
177
|
+
break
|
178
|
+
# If the version does not match, add it to the list of unfulfilled requirement options.
|
179
|
+
required_any.append(str(dep))
|
180
|
+
found_any.append(f"{req.name} {dist_version}")
|
181
|
+
|
182
|
+
if is_dependency_conflict:
|
183
|
+
return DependencyConflict(
|
184
|
+
required_any=required_any,
|
185
|
+
found_any=found_any,
|
186
|
+
)
|
76
187
|
return None
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: opentelemetry-instrumentation
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.57b0
|
4
4
|
Summary: Instrumentation Tools & Auto Instrumentation for OpenTelemetry Python
|
5
5
|
Project-URL: Homepage, https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/opentelemetry-instrumentation
|
6
6
|
Project-URL: Repository, https://github.com/open-telemetry/opentelemetry-python-contrib
|
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.13
|
20
20
|
Requires-Python: >=3.9
|
21
21
|
Requires-Dist: opentelemetry-api~=1.4
|
22
|
-
Requires-Dist: opentelemetry-semantic-conventions==0.
|
22
|
+
Requires-Dist: opentelemetry-semantic-conventions==0.57b0
|
23
23
|
Requires-Dist: packaging>=18.0
|
24
24
|
Requires-Dist: wrapt<2.0.0,>=1.0.0
|
25
25
|
Description-Content-Type: text/x-rst
|
@@ -1,7 +1,7 @@
|
|
1
1
|
opentelemetry/instrumentation/_semconv.py,sha256=3WGq8pHAq1iI0pPGDzKgs25XnTXKCxfa3QP3esI-buE,15401
|
2
2
|
opentelemetry/instrumentation/bootstrap.py,sha256=Q-1j1G7QKXTTvH5xGGGRX3jCpTf_NuhBoy2X_MvM9sg,5428
|
3
|
-
opentelemetry/instrumentation/bootstrap_gen.py,sha256=
|
4
|
-
opentelemetry/instrumentation/dependencies.py,sha256=
|
3
|
+
opentelemetry/instrumentation/bootstrap_gen.py,sha256=cPqL-nclsI0KoWBoyRVGzpkzORbAOMEX3XriTSR7uxs,7629
|
4
|
+
opentelemetry/instrumentation/dependencies.py,sha256=4KBJH2u_IHKLvyBHyJENJgNjCapzN-i32RMb2ibTJ88,6608
|
5
5
|
opentelemetry/instrumentation/distro.py,sha256=l7wjM9eR44X-Bk6w-b3_kW3_QgW82OiITRTOY48shZk,2168
|
6
6
|
opentelemetry/instrumentation/environment_variables.py,sha256=oRcbNSSbnqJMQ3r4gBhK6jqtuI5WizapP962Z8DrVZ8,905
|
7
7
|
opentelemetry/instrumentation/instrumentor.py,sha256=5nKN5yGZHOiNoiMBbbB_QOdjayyBAx3PP1C8KpUWRiY,5022
|
@@ -9,12 +9,12 @@ opentelemetry/instrumentation/propagators.py,sha256=hBkG70KlMUiTjxPeiyOhkb_eE96D
|
|
9
9
|
opentelemetry/instrumentation/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
opentelemetry/instrumentation/sqlcommenter_utils.py,sha256=oh97wDXsXvU8GdxGRpWGxcneAz5_dwTBa1U-OVp0zMU,1963
|
11
11
|
opentelemetry/instrumentation/utils.py,sha256=-_D9pwXqGGsq6yUuj88TV7GpaYeatPWDpSmpf-nKpFQ,7117
|
12
|
-
opentelemetry/instrumentation/version.py,sha256=
|
12
|
+
opentelemetry/instrumentation/version.py,sha256=Q5HertrmLRVt4tr9uzo3rMgUo0jPRhv7CHMT4epUldg,608
|
13
13
|
opentelemetry/instrumentation/auto_instrumentation/__init__.py,sha256=H0cTlxCpdudhhr8IoXjpgCdsH6aDYgPTdTzu06WrEVc,4903
|
14
|
-
opentelemetry/instrumentation/auto_instrumentation/_load.py,sha256=
|
14
|
+
opentelemetry/instrumentation/auto_instrumentation/_load.py,sha256=sZtYIiP0u4LqF3YIOzYiEwKy-CDezTDOKmosnUPtTkA,7333
|
15
15
|
opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py,sha256=3c-4MTChVWO-PpdQLpIHPp0M9pZDqnPEEN-jch6v4mU,673
|
16
|
-
opentelemetry_instrumentation-0.
|
17
|
-
opentelemetry_instrumentation-0.
|
18
|
-
opentelemetry_instrumentation-0.
|
19
|
-
opentelemetry_instrumentation-0.
|
20
|
-
opentelemetry_instrumentation-0.
|
16
|
+
opentelemetry_instrumentation-0.57b0.dist-info/METADATA,sha256=laO-BKv6FjeE1AvEr4wbn7X23pklhpt-89Gmpnj2Xz4,6748
|
17
|
+
opentelemetry_instrumentation-0.57b0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
18
|
+
opentelemetry_instrumentation-0.57b0.dist-info/entry_points.txt,sha256=iVv3t5REB0O58tFUEQQXYLrTCa1VVOFUXfrbvUk6_aU,279
|
19
|
+
opentelemetry_instrumentation-0.57b0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
20
|
+
opentelemetry_instrumentation-0.57b0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|