opentelemetry-instrumentation 0.45b0__py3-none-any.whl → 0.46b0__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/_semconv.py +243 -74
- opentelemetry/instrumentation/bootstrap.py +25 -16
- opentelemetry/instrumentation/bootstrap_gen.py +51 -50
- opentelemetry/instrumentation/distro.py +4 -3
- opentelemetry/instrumentation/version.py +1 -1
- {opentelemetry_instrumentation-0.45b0.dist-info → opentelemetry_instrumentation-0.46b0.dist-info}/METADATA +1 -1
- {opentelemetry_instrumentation-0.45b0.dist-info → opentelemetry_instrumentation-0.46b0.dist-info}/RECORD +10 -10
- {opentelemetry_instrumentation-0.45b0.dist-info → opentelemetry_instrumentation-0.46b0.dist-info}/WHEEL +1 -1
- {opentelemetry_instrumentation-0.45b0.dist-info → opentelemetry_instrumentation-0.46b0.dist-info}/licenses/LICENSE +1 -1
- {opentelemetry_instrumentation-0.45b0.dist-info → opentelemetry_instrumentation-0.46b0.dist-info}/entry_points.txt +0 -0
@@ -16,13 +16,16 @@ import os
|
|
16
16
|
import threading
|
17
17
|
from enum import Enum
|
18
18
|
|
19
|
+
from opentelemetry.instrumentation.utils import http_status_to_status_code
|
19
20
|
from opentelemetry.semconv.trace import SpanAttributes
|
21
|
+
from opentelemetry.trace.status import Status, StatusCode
|
20
22
|
|
21
23
|
# TODO: will come through semconv package once updated
|
22
24
|
_SPAN_ATTRIBUTES_ERROR_TYPE = "error.type"
|
23
25
|
_SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS = "network.peer.address"
|
24
26
|
_SPAN_ATTRIBUTES_NETWORK_PEER_PORT = "network.peer.port"
|
25
27
|
_METRIC_ATTRIBUTES_CLIENT_DURATION_NAME = "http.client.request.duration"
|
28
|
+
_METRIC_ATTRIBUTES_SERVER_DURATION_NAME = "http.server.request.duration"
|
26
29
|
|
27
30
|
_client_duration_attrs_old = [
|
28
31
|
SpanAttributes.HTTP_STATUS_CODE,
|
@@ -45,13 +48,116 @@ _client_duration_attrs_new = [
|
|
45
48
|
# SpanAttributes.URL_SCHEME,
|
46
49
|
]
|
47
50
|
|
51
|
+
_server_duration_attrs_old = [
|
52
|
+
SpanAttributes.HTTP_METHOD,
|
53
|
+
SpanAttributes.HTTP_HOST,
|
54
|
+
SpanAttributes.HTTP_SCHEME,
|
55
|
+
SpanAttributes.HTTP_STATUS_CODE,
|
56
|
+
SpanAttributes.HTTP_FLAVOR,
|
57
|
+
SpanAttributes.HTTP_SERVER_NAME,
|
58
|
+
SpanAttributes.NET_HOST_NAME,
|
59
|
+
SpanAttributes.NET_HOST_PORT,
|
60
|
+
]
|
61
|
+
|
62
|
+
_server_duration_attrs_new = [
|
63
|
+
_SPAN_ATTRIBUTES_ERROR_TYPE,
|
64
|
+
SpanAttributes.HTTP_REQUEST_METHOD,
|
65
|
+
SpanAttributes.HTTP_RESPONSE_STATUS_CODE,
|
66
|
+
SpanAttributes.HTTP_ROUTE,
|
67
|
+
SpanAttributes.NETWORK_PROTOCOL_VERSION,
|
68
|
+
SpanAttributes.URL_SCHEME,
|
69
|
+
]
|
70
|
+
|
71
|
+
_server_active_requests_count_attrs_old = [
|
72
|
+
SpanAttributes.HTTP_METHOD,
|
73
|
+
SpanAttributes.HTTP_HOST,
|
74
|
+
SpanAttributes.HTTP_SCHEME,
|
75
|
+
SpanAttributes.HTTP_FLAVOR,
|
76
|
+
SpanAttributes.HTTP_SERVER_NAME,
|
77
|
+
SpanAttributes.NET_HOST_NAME,
|
78
|
+
SpanAttributes.NET_HOST_PORT,
|
79
|
+
]
|
80
|
+
|
81
|
+
_server_active_requests_count_attrs_new = [
|
82
|
+
SpanAttributes.HTTP_REQUEST_METHOD,
|
83
|
+
SpanAttributes.URL_SCHEME,
|
84
|
+
]
|
85
|
+
|
86
|
+
OTEL_SEMCONV_STABILITY_OPT_IN = "OTEL_SEMCONV_STABILITY_OPT_IN"
|
87
|
+
|
88
|
+
|
89
|
+
class _OpenTelemetryStabilitySignalType:
|
90
|
+
HTTP = "http"
|
91
|
+
|
92
|
+
|
93
|
+
class _HTTPStabilityMode(Enum):
|
94
|
+
# http - emit the new, stable HTTP and networking conventions ONLY
|
95
|
+
HTTP = "http"
|
96
|
+
# http/dup - emit both the old and the stable HTTP and networking conventions
|
97
|
+
HTTP_DUP = "http/dup"
|
98
|
+
# default - continue emitting old experimental HTTP and networking conventions
|
99
|
+
DEFAULT = "default"
|
100
|
+
|
101
|
+
|
102
|
+
def _report_new(mode):
|
103
|
+
return mode.name != _HTTPStabilityMode.DEFAULT.name
|
104
|
+
|
105
|
+
|
106
|
+
def _report_old(mode):
|
107
|
+
return mode.name != _HTTPStabilityMode.HTTP.name
|
108
|
+
|
109
|
+
|
110
|
+
class _OpenTelemetrySemanticConventionStability:
|
111
|
+
_initialized = False
|
112
|
+
_lock = threading.Lock()
|
113
|
+
_OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING = {}
|
114
|
+
|
115
|
+
@classmethod
|
116
|
+
def _initialize(cls):
|
117
|
+
with _OpenTelemetrySemanticConventionStability._lock:
|
118
|
+
if not _OpenTelemetrySemanticConventionStability._initialized:
|
119
|
+
# Users can pass in comma delimited string for opt-in options
|
120
|
+
# Only values for http stability are supported for now
|
121
|
+
opt_in = os.environ.get(OTEL_SEMCONV_STABILITY_OPT_IN, "")
|
122
|
+
opt_in_list = []
|
123
|
+
if opt_in:
|
124
|
+
opt_in_list = [s.strip() for s in opt_in.split(",")]
|
125
|
+
http_opt_in = _HTTPStabilityMode.DEFAULT
|
126
|
+
if opt_in_list:
|
127
|
+
# Process http opt-in
|
128
|
+
# http/dup takes priority over http
|
129
|
+
if _HTTPStabilityMode.HTTP_DUP.value in opt_in_list:
|
130
|
+
http_opt_in = _HTTPStabilityMode.HTTP_DUP
|
131
|
+
elif _HTTPStabilityMode.HTTP.value in opt_in_list:
|
132
|
+
http_opt_in = _HTTPStabilityMode.HTTP
|
133
|
+
_OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING[
|
134
|
+
_OpenTelemetryStabilitySignalType.HTTP
|
135
|
+
] = http_opt_in
|
136
|
+
_OpenTelemetrySemanticConventionStability._initialized = True
|
48
137
|
|
49
|
-
|
138
|
+
@classmethod
|
139
|
+
# Get OpenTelemetry opt-in mode based off of signal type (http, messaging, etc.)
|
140
|
+
def _get_opentelemetry_stability_opt_in_mode(
|
141
|
+
cls,
|
142
|
+
signal_type: _OpenTelemetryStabilitySignalType,
|
143
|
+
) -> _HTTPStabilityMode:
|
144
|
+
return _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING.get(
|
145
|
+
signal_type, _HTTPStabilityMode.DEFAULT
|
146
|
+
)
|
147
|
+
|
148
|
+
|
149
|
+
def _filter_semconv_duration_attrs(
|
150
|
+
attrs,
|
151
|
+
old_attrs,
|
152
|
+
new_attrs,
|
153
|
+
sem_conv_opt_in_mode=_HTTPStabilityMode.DEFAULT,
|
154
|
+
):
|
50
155
|
filtered_attrs = {}
|
156
|
+
# duration is two different metrics depending on sem_conv_opt_in_mode, so no DUP attributes
|
51
157
|
allowed_attributes = (
|
52
|
-
|
53
|
-
if sem_conv_opt_in_mode ==
|
54
|
-
else
|
158
|
+
new_attrs
|
159
|
+
if sem_conv_opt_in_mode == _HTTPStabilityMode.HTTP
|
160
|
+
else old_attrs
|
55
161
|
)
|
56
162
|
for key, val in attrs.items():
|
57
163
|
if key in allowed_attributes:
|
@@ -59,6 +165,24 @@ def _filter_duration_attrs(attrs, sem_conv_opt_in_mode):
|
|
59
165
|
return filtered_attrs
|
60
166
|
|
61
167
|
|
168
|
+
def _filter_semconv_active_request_count_attr(
|
169
|
+
attrs,
|
170
|
+
old_attrs,
|
171
|
+
new_attrs,
|
172
|
+
sem_conv_opt_in_mode=_HTTPStabilityMode.DEFAULT,
|
173
|
+
):
|
174
|
+
filtered_attrs = {}
|
175
|
+
if _report_old(sem_conv_opt_in_mode):
|
176
|
+
for key, val in attrs.items():
|
177
|
+
if key in old_attrs:
|
178
|
+
filtered_attrs[key] = val
|
179
|
+
if _report_new(sem_conv_opt_in_mode):
|
180
|
+
for key, val in attrs.items():
|
181
|
+
if key in new_attrs:
|
182
|
+
filtered_attrs[key] = val
|
183
|
+
return filtered_attrs
|
184
|
+
|
185
|
+
|
62
186
|
def set_string_attribute(result, key, value):
|
63
187
|
if value:
|
64
188
|
result[key] = value
|
@@ -90,6 +214,15 @@ def _set_http_method(result, original, normalized, sem_conv_opt_in_mode):
|
|
90
214
|
)
|
91
215
|
|
92
216
|
|
217
|
+
def _set_http_status_code(result, code, sem_conv_opt_in_mode):
|
218
|
+
if _report_old(sem_conv_opt_in_mode):
|
219
|
+
set_int_attribute(result, SpanAttributes.HTTP_STATUS_CODE, code)
|
220
|
+
if _report_new(sem_conv_opt_in_mode):
|
221
|
+
set_int_attribute(
|
222
|
+
result, SpanAttributes.HTTP_RESPONSE_STATUS_CODE, code
|
223
|
+
)
|
224
|
+
|
225
|
+
|
93
226
|
def _set_http_url(result, url, sem_conv_opt_in_mode):
|
94
227
|
if _report_old(sem_conv_opt_in_mode):
|
95
228
|
set_string_attribute(result, SpanAttributes.HTTP_URL, url)
|
@@ -100,41 +233,34 @@ def _set_http_url(result, url, sem_conv_opt_in_mode):
|
|
100
233
|
def _set_http_scheme(result, scheme, sem_conv_opt_in_mode):
|
101
234
|
if _report_old(sem_conv_opt_in_mode):
|
102
235
|
set_string_attribute(result, SpanAttributes.HTTP_SCHEME, scheme)
|
103
|
-
|
104
|
-
|
105
|
-
# set_string_attribute(result, SpanAttributes.URL_SCHEME, scheme)
|
236
|
+
if _report_new(sem_conv_opt_in_mode):
|
237
|
+
set_string_attribute(result, SpanAttributes.URL_SCHEME, scheme)
|
106
238
|
|
107
239
|
|
108
|
-
def
|
240
|
+
def _set_http_host(result, host, sem_conv_opt_in_mode):
|
109
241
|
if _report_old(sem_conv_opt_in_mode):
|
110
|
-
set_string_attribute(result, SpanAttributes.HTTP_HOST,
|
242
|
+
set_string_attribute(result, SpanAttributes.HTTP_HOST, host)
|
111
243
|
if _report_new(sem_conv_opt_in_mode):
|
112
|
-
set_string_attribute(result, SpanAttributes.SERVER_ADDRESS,
|
244
|
+
set_string_attribute(result, SpanAttributes.SERVER_ADDRESS, host)
|
245
|
+
|
113
246
|
|
247
|
+
# Client
|
114
248
|
|
115
|
-
|
249
|
+
|
250
|
+
def _set_http_net_peer_name_client(result, peer_name, sem_conv_opt_in_mode):
|
116
251
|
if _report_old(sem_conv_opt_in_mode):
|
117
252
|
set_string_attribute(result, SpanAttributes.NET_PEER_NAME, peer_name)
|
118
253
|
if _report_new(sem_conv_opt_in_mode):
|
119
254
|
set_string_attribute(result, SpanAttributes.SERVER_ADDRESS, peer_name)
|
120
255
|
|
121
256
|
|
122
|
-
def
|
257
|
+
def _set_http_peer_port_client(result, port, sem_conv_opt_in_mode):
|
123
258
|
if _report_old(sem_conv_opt_in_mode):
|
124
259
|
set_int_attribute(result, SpanAttributes.NET_PEER_PORT, port)
|
125
260
|
if _report_new(sem_conv_opt_in_mode):
|
126
261
|
set_int_attribute(result, SpanAttributes.SERVER_PORT, port)
|
127
262
|
|
128
263
|
|
129
|
-
def _set_http_status_code(result, code, sem_conv_opt_in_mode):
|
130
|
-
if _report_old(sem_conv_opt_in_mode):
|
131
|
-
set_int_attribute(result, SpanAttributes.HTTP_STATUS_CODE, code)
|
132
|
-
if _report_new(sem_conv_opt_in_mode):
|
133
|
-
set_int_attribute(
|
134
|
-
result, SpanAttributes.HTTP_RESPONSE_STATUS_CODE, code
|
135
|
-
)
|
136
|
-
|
137
|
-
|
138
264
|
def _set_http_network_protocol_version(result, version, sem_conv_opt_in_mode):
|
139
265
|
if _report_old(sem_conv_opt_in_mode):
|
140
266
|
set_string_attribute(result, SpanAttributes.HTTP_FLAVOR, version)
|
@@ -144,74 +270,117 @@ def _set_http_network_protocol_version(result, version, sem_conv_opt_in_mode):
|
|
144
270
|
)
|
145
271
|
|
146
272
|
|
147
|
-
|
273
|
+
# Server
|
148
274
|
|
149
275
|
|
150
|
-
|
151
|
-
|
276
|
+
def _set_http_net_host(result, host, sem_conv_opt_in_mode):
|
277
|
+
if _report_old(sem_conv_opt_in_mode):
|
278
|
+
set_string_attribute(result, SpanAttributes.NET_HOST_NAME, host)
|
279
|
+
if _report_new(sem_conv_opt_in_mode):
|
280
|
+
set_string_attribute(result, SpanAttributes.SERVER_ADDRESS, host)
|
152
281
|
|
153
282
|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
# default - continue emitting old experimental HTTP and networking conventions
|
160
|
-
DEFAULT = "default"
|
283
|
+
def _set_http_net_host_port(result, port, sem_conv_opt_in_mode):
|
284
|
+
if _report_old(sem_conv_opt_in_mode):
|
285
|
+
set_int_attribute(result, SpanAttributes.NET_HOST_PORT, port)
|
286
|
+
if _report_new(sem_conv_opt_in_mode):
|
287
|
+
set_int_attribute(result, SpanAttributes.SERVER_PORT, port)
|
161
288
|
|
162
289
|
|
163
|
-
def
|
164
|
-
|
290
|
+
def _set_http_target(result, target, path, query, sem_conv_opt_in_mode):
|
291
|
+
if _report_old(sem_conv_opt_in_mode):
|
292
|
+
set_string_attribute(result, SpanAttributes.HTTP_TARGET, target)
|
293
|
+
if _report_new(sem_conv_opt_in_mode):
|
294
|
+
if path:
|
295
|
+
set_string_attribute(result, SpanAttributes.URL_PATH, path)
|
296
|
+
if query:
|
297
|
+
set_string_attribute(result, SpanAttributes.URL_QUERY, query)
|
165
298
|
|
166
299
|
|
167
|
-
def
|
168
|
-
|
300
|
+
def _set_http_peer_ip(result, ip, sem_conv_opt_in_mode):
|
301
|
+
if _report_old(sem_conv_opt_in_mode):
|
302
|
+
set_string_attribute(result, SpanAttributes.NET_PEER_IP, ip)
|
303
|
+
if _report_new(sem_conv_opt_in_mode):
|
304
|
+
set_string_attribute(result, SpanAttributes.CLIENT_ADDRESS, ip)
|
169
305
|
|
170
306
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
307
|
+
def _set_http_peer_port_server(result, port, sem_conv_opt_in_mode):
|
308
|
+
if _report_old(sem_conv_opt_in_mode):
|
309
|
+
set_int_attribute(result, SpanAttributes.NET_PEER_PORT, port)
|
310
|
+
if _report_new(sem_conv_opt_in_mode):
|
311
|
+
set_int_attribute(result, SpanAttributes.CLIENT_PORT, port)
|
175
312
|
|
176
|
-
@classmethod
|
177
|
-
def _initialize(cls):
|
178
|
-
with _OpenTelemetrySemanticConventionStability._lock:
|
179
|
-
if not _OpenTelemetrySemanticConventionStability._initialized:
|
180
|
-
# Users can pass in comma delimited string for opt-in options
|
181
|
-
# Only values for http stability are supported for now
|
182
|
-
opt_in = os.environ.get(_OTEL_SEMCONV_STABILITY_OPT_IN_KEY, "")
|
183
|
-
opt_in_list = []
|
184
|
-
if opt_in:
|
185
|
-
opt_in_list = [s.strip() for s in opt_in.split(",")]
|
186
|
-
http_opt_in = _OpenTelemetryStabilityMode.DEFAULT
|
187
|
-
if opt_in_list:
|
188
|
-
# Process http opt-in
|
189
|
-
# http/dup takes priority over http
|
190
|
-
if (
|
191
|
-
_OpenTelemetryStabilityMode.HTTP_DUP.value
|
192
|
-
in opt_in_list
|
193
|
-
):
|
194
|
-
http_opt_in = _OpenTelemetryStabilityMode.HTTP_DUP
|
195
|
-
elif _OpenTelemetryStabilityMode.HTTP.value in opt_in_list:
|
196
|
-
http_opt_in = _OpenTelemetryStabilityMode.HTTP
|
197
|
-
_OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING[
|
198
|
-
_OpenTelemetryStabilitySignalType.HTTP
|
199
|
-
] = http_opt_in
|
200
|
-
_OpenTelemetrySemanticConventionStability._initialized = True
|
201
313
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
)
|
208
|
-
|
209
|
-
|
314
|
+
def _set_http_user_agent(result, user_agent, sem_conv_opt_in_mode):
|
315
|
+
if _report_old(sem_conv_opt_in_mode):
|
316
|
+
set_string_attribute(
|
317
|
+
result, SpanAttributes.HTTP_USER_AGENT, user_agent
|
318
|
+
)
|
319
|
+
if _report_new(sem_conv_opt_in_mode):
|
320
|
+
set_string_attribute(
|
321
|
+
result, SpanAttributes.USER_AGENT_ORIGINAL, user_agent
|
322
|
+
)
|
323
|
+
|
324
|
+
|
325
|
+
def _set_http_net_peer_name_server(result, name, sem_conv_opt_in_mode):
|
326
|
+
if _report_old(sem_conv_opt_in_mode):
|
327
|
+
set_string_attribute(result, SpanAttributes.NET_PEER_NAME, name)
|
328
|
+
if _report_new(sem_conv_opt_in_mode):
|
329
|
+
set_string_attribute(result, SpanAttributes.CLIENT_ADDRESS, name)
|
330
|
+
|
331
|
+
|
332
|
+
def _set_http_flavor_version(result, version, sem_conv_opt_in_mode):
|
333
|
+
if _report_old(sem_conv_opt_in_mode):
|
334
|
+
set_string_attribute(result, SpanAttributes.HTTP_FLAVOR, version)
|
335
|
+
if _report_new(sem_conv_opt_in_mode):
|
336
|
+
set_string_attribute(
|
337
|
+
result, SpanAttributes.NETWORK_PROTOCOL_VERSION, version
|
338
|
+
)
|
339
|
+
|
340
|
+
|
341
|
+
def _set_status(
|
342
|
+
span,
|
343
|
+
metrics_attributes,
|
344
|
+
status_code_str,
|
345
|
+
status_code,
|
346
|
+
sem_conv_opt_in_mode,
|
347
|
+
):
|
348
|
+
if status_code < 0:
|
349
|
+
if _report_new(sem_conv_opt_in_mode):
|
350
|
+
span.set_attribute(_SPAN_ATTRIBUTES_ERROR_TYPE, status_code_str)
|
351
|
+
metrics_attributes[_SPAN_ATTRIBUTES_ERROR_TYPE] = status_code_str
|
352
|
+
|
353
|
+
span.set_status(
|
354
|
+
Status(
|
355
|
+
StatusCode.ERROR,
|
356
|
+
"Non-integer HTTP status: " + status_code_str,
|
357
|
+
)
|
210
358
|
)
|
359
|
+
else:
|
360
|
+
status = http_status_to_status_code(status_code, server_span=True)
|
361
|
+
|
362
|
+
if _report_old(sem_conv_opt_in_mode):
|
363
|
+
span.set_attribute(SpanAttributes.HTTP_STATUS_CODE, status_code)
|
364
|
+
metrics_attributes[SpanAttributes.HTTP_STATUS_CODE] = status_code
|
365
|
+
if _report_new(sem_conv_opt_in_mode):
|
366
|
+
span.set_attribute(
|
367
|
+
SpanAttributes.HTTP_RESPONSE_STATUS_CODE, status_code
|
368
|
+
)
|
369
|
+
metrics_attributes[SpanAttributes.HTTP_RESPONSE_STATUS_CODE] = (
|
370
|
+
status_code
|
371
|
+
)
|
372
|
+
if status == StatusCode.ERROR:
|
373
|
+
span.set_attribute(
|
374
|
+
_SPAN_ATTRIBUTES_ERROR_TYPE, status_code_str
|
375
|
+
)
|
376
|
+
metrics_attributes[_SPAN_ATTRIBUTES_ERROR_TYPE] = (
|
377
|
+
status_code_str
|
378
|
+
)
|
379
|
+
span.set_status(Status(status))
|
211
380
|
|
212
381
|
|
213
382
|
# Get schema version based off of opt-in mode
|
214
|
-
def _get_schema_url(mode:
|
215
|
-
if mode is
|
383
|
+
def _get_schema_url(mode: _HTTPStabilityMode) -> str:
|
384
|
+
if mode is _HTTPStabilityMode.DEFAULT:
|
216
385
|
return "https://opentelemetry.io/schemas/1.11.0"
|
217
386
|
return SpanAttributes.SCHEMA_URL
|
@@ -14,8 +14,14 @@
|
|
14
14
|
|
15
15
|
import argparse
|
16
16
|
import logging
|
17
|
-
import subprocess
|
18
17
|
import sys
|
18
|
+
from subprocess import (
|
19
|
+
PIPE,
|
20
|
+
CalledProcessError,
|
21
|
+
Popen,
|
22
|
+
SubprocessError,
|
23
|
+
check_call,
|
24
|
+
)
|
19
25
|
|
20
26
|
import pkg_resources
|
21
27
|
|
@@ -34,7 +40,7 @@ def _syscall(func):
|
|
34
40
|
if package:
|
35
41
|
return func(package)
|
36
42
|
return func()
|
37
|
-
except
|
43
|
+
except SubprocessError as exp:
|
38
44
|
cmd = getattr(exp, "cmd", None)
|
39
45
|
if cmd:
|
40
46
|
msg = f'Error calling system command "{" ".join(cmd)}"'
|
@@ -48,18 +54,21 @@ def _syscall(func):
|
|
48
54
|
@_syscall
|
49
55
|
def _sys_pip_install(package):
|
50
56
|
# explicit upgrade strategy to override potential pip config
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
57
|
+
try:
|
58
|
+
check_call(
|
59
|
+
[
|
60
|
+
sys.executable,
|
61
|
+
"-m",
|
62
|
+
"pip",
|
63
|
+
"install",
|
64
|
+
"-U",
|
65
|
+
"--upgrade-strategy",
|
66
|
+
"only-if-needed",
|
67
|
+
package,
|
68
|
+
]
|
69
|
+
)
|
70
|
+
except CalledProcessError as error:
|
71
|
+
print(error)
|
63
72
|
|
64
73
|
|
65
74
|
def _pip_check():
|
@@ -70,8 +79,8 @@ def _pip_check():
|
|
70
79
|
'opentelemetry-instrumentation-flask 1.0.1 has requirement opentelemetry-sdk<2.0,>=1.0, but you have opentelemetry-sdk 0.5.'
|
71
80
|
To not be too restrictive, we'll only check for relevant packages.
|
72
81
|
"""
|
73
|
-
with
|
74
|
-
[sys.executable, "-m", "pip", "check"], stdout=
|
82
|
+
with Popen(
|
83
|
+
[sys.executable, "-m", "pip", "check"], stdout=PIPE
|
75
84
|
) as check_pipe:
|
76
85
|
pip_check = check_pipe.communicate()[0].decode()
|
77
86
|
pip_check_lower = pip_check.lower()
|
@@ -18,179 +18,180 @@
|
|
18
18
|
libraries = [
|
19
19
|
{
|
20
20
|
"library": "aio_pika >= 7.2.0, < 10.0.0",
|
21
|
-
"instrumentation": "opentelemetry-instrumentation-aio-pika==0.
|
21
|
+
"instrumentation": "opentelemetry-instrumentation-aio-pika==0.46b0",
|
22
22
|
},
|
23
23
|
{
|
24
24
|
"library": "aiohttp ~= 3.0",
|
25
|
-
"instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.
|
25
|
+
"instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.46b0",
|
26
26
|
},
|
27
27
|
{
|
28
28
|
"library": "aiohttp ~= 3.0",
|
29
|
-
"instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.
|
29
|
+
"instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.46b0",
|
30
30
|
},
|
31
31
|
{
|
32
32
|
"library": "aiopg >= 0.13.0, < 2.0.0",
|
33
|
-
"instrumentation": "opentelemetry-instrumentation-aiopg==0.
|
33
|
+
"instrumentation": "opentelemetry-instrumentation-aiopg==0.46b0",
|
34
34
|
},
|
35
35
|
{
|
36
36
|
"library": "asgiref ~= 3.0",
|
37
|
-
"instrumentation": "opentelemetry-instrumentation-asgi==0.
|
37
|
+
"instrumentation": "opentelemetry-instrumentation-asgi==0.46b0",
|
38
38
|
},
|
39
39
|
{
|
40
40
|
"library": "asyncpg >= 0.12.0",
|
41
|
-
"instrumentation": "opentelemetry-instrumentation-asyncpg==0.
|
41
|
+
"instrumentation": "opentelemetry-instrumentation-asyncpg==0.46b0",
|
42
42
|
},
|
43
43
|
{
|
44
44
|
"library": "boto~=2.0",
|
45
|
-
"instrumentation": "opentelemetry-instrumentation-boto==0.
|
45
|
+
"instrumentation": "opentelemetry-instrumentation-boto==0.46b0",
|
46
46
|
},
|
47
47
|
{
|
48
48
|
"library": "boto3 ~= 1.0",
|
49
|
-
"instrumentation": "opentelemetry-instrumentation-boto3sqs==0.
|
49
|
+
"instrumentation": "opentelemetry-instrumentation-boto3sqs==0.46b0",
|
50
50
|
},
|
51
51
|
{
|
52
52
|
"library": "botocore ~= 1.0",
|
53
|
-
"instrumentation": "opentelemetry-instrumentation-botocore==0.
|
53
|
+
"instrumentation": "opentelemetry-instrumentation-botocore==0.46b0",
|
54
54
|
},
|
55
55
|
{
|
56
56
|
"library": "cassandra-driver ~= 3.25",
|
57
|
-
"instrumentation": "opentelemetry-instrumentation-cassandra==0.
|
57
|
+
"instrumentation": "opentelemetry-instrumentation-cassandra==0.46b0",
|
58
58
|
},
|
59
59
|
{
|
60
60
|
"library": "scylla-driver ~= 3.25",
|
61
|
-
"instrumentation": "opentelemetry-instrumentation-cassandra==0.
|
61
|
+
"instrumentation": "opentelemetry-instrumentation-cassandra==0.46b0",
|
62
62
|
},
|
63
63
|
{
|
64
64
|
"library": "celery >= 4.0, < 6.0",
|
65
|
-
"instrumentation": "opentelemetry-instrumentation-celery==0.
|
65
|
+
"instrumentation": "opentelemetry-instrumentation-celery==0.46b0",
|
66
66
|
},
|
67
67
|
{
|
68
68
|
"library": "confluent-kafka >= 1.8.2, <= 2.3.0",
|
69
|
-
"instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.
|
69
|
+
"instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.46b0",
|
70
70
|
},
|
71
71
|
{
|
72
72
|
"library": "django >= 1.10",
|
73
|
-
"instrumentation": "opentelemetry-instrumentation-django==0.
|
73
|
+
"instrumentation": "opentelemetry-instrumentation-django==0.46b0",
|
74
74
|
},
|
75
75
|
{
|
76
|
-
"library": "elasticsearch >=
|
77
|
-
"instrumentation": "opentelemetry-instrumentation-elasticsearch==0.
|
76
|
+
"library": "elasticsearch >= 6.0",
|
77
|
+
"instrumentation": "opentelemetry-instrumentation-elasticsearch==0.46b0",
|
78
78
|
},
|
79
79
|
{
|
80
80
|
"library": "falcon >= 1.4.1, < 3.1.2",
|
81
|
-
"instrumentation": "opentelemetry-instrumentation-falcon==0.
|
81
|
+
"instrumentation": "opentelemetry-instrumentation-falcon==0.46b0",
|
82
82
|
},
|
83
83
|
{
|
84
84
|
"library": "fastapi ~= 0.58",
|
85
|
-
"instrumentation": "opentelemetry-instrumentation-fastapi==0.
|
85
|
+
"instrumentation": "opentelemetry-instrumentation-fastapi==0.46b0",
|
86
86
|
},
|
87
87
|
{
|
88
88
|
"library": "flask >= 1.0",
|
89
|
-
"instrumentation": "opentelemetry-instrumentation-flask==0.
|
89
|
+
"instrumentation": "opentelemetry-instrumentation-flask==0.46b0",
|
90
90
|
},
|
91
91
|
{
|
92
92
|
"library": "grpcio ~= 1.27",
|
93
|
-
"instrumentation": "opentelemetry-instrumentation-grpc==0.
|
93
|
+
"instrumentation": "opentelemetry-instrumentation-grpc==0.46b0",
|
94
94
|
},
|
95
95
|
{
|
96
96
|
"library": "httpx >= 0.18.0",
|
97
|
-
"instrumentation": "opentelemetry-instrumentation-httpx==0.
|
97
|
+
"instrumentation": "opentelemetry-instrumentation-httpx==0.46b0",
|
98
98
|
},
|
99
99
|
{
|
100
100
|
"library": "jinja2 >= 2.7, < 4.0",
|
101
|
-
"instrumentation": "opentelemetry-instrumentation-jinja2==0.
|
101
|
+
"instrumentation": "opentelemetry-instrumentation-jinja2==0.46b0",
|
102
102
|
},
|
103
103
|
{
|
104
104
|
"library": "kafka-python >= 2.0",
|
105
|
-
"instrumentation": "opentelemetry-instrumentation-kafka-python==0.
|
105
|
+
"instrumentation": "opentelemetry-instrumentation-kafka-python==0.46b0",
|
106
106
|
},
|
107
107
|
{
|
108
108
|
"library": "mysql-connector-python ~= 8.0",
|
109
|
-
"instrumentation": "opentelemetry-instrumentation-mysql==0.
|
109
|
+
"instrumentation": "opentelemetry-instrumentation-mysql==0.46b0",
|
110
110
|
},
|
111
111
|
{
|
112
112
|
"library": "mysqlclient < 3",
|
113
|
-
"instrumentation": "opentelemetry-instrumentation-mysqlclient==0.
|
113
|
+
"instrumentation": "opentelemetry-instrumentation-mysqlclient==0.46b0",
|
114
114
|
},
|
115
115
|
{
|
116
116
|
"library": "pika >= 0.12.0",
|
117
|
-
"instrumentation": "opentelemetry-instrumentation-pika==0.
|
117
|
+
"instrumentation": "opentelemetry-instrumentation-pika==0.46b0",
|
118
118
|
},
|
119
119
|
{
|
120
120
|
"library": "psycopg >= 3.1.0",
|
121
|
-
"instrumentation": "opentelemetry-instrumentation-psycopg==0.
|
121
|
+
"instrumentation": "opentelemetry-instrumentation-psycopg==0.46b0",
|
122
122
|
},
|
123
123
|
{
|
124
124
|
"library": "psycopg2 >= 2.7.3.1",
|
125
|
-
"instrumentation": "opentelemetry-instrumentation-psycopg2==0.
|
125
|
+
"instrumentation": "opentelemetry-instrumentation-psycopg2==0.46b0",
|
126
126
|
},
|
127
127
|
{
|
128
128
|
"library": "pymemcache >= 1.3.5, < 5",
|
129
|
-
"instrumentation": "opentelemetry-instrumentation-pymemcache==0.
|
129
|
+
"instrumentation": "opentelemetry-instrumentation-pymemcache==0.46b0",
|
130
130
|
},
|
131
131
|
{
|
132
132
|
"library": "pymongo >= 3.1, < 5.0",
|
133
|
-
"instrumentation": "opentelemetry-instrumentation-pymongo==0.
|
133
|
+
"instrumentation": "opentelemetry-instrumentation-pymongo==0.46b0",
|
134
134
|
},
|
135
135
|
{
|
136
136
|
"library": "PyMySQL < 2",
|
137
|
-
"instrumentation": "opentelemetry-instrumentation-pymysql==0.
|
137
|
+
"instrumentation": "opentelemetry-instrumentation-pymysql==0.46b0",
|
138
138
|
},
|
139
139
|
{
|
140
140
|
"library": "pyramid >= 1.7",
|
141
|
-
"instrumentation": "opentelemetry-instrumentation-pyramid==0.
|
141
|
+
"instrumentation": "opentelemetry-instrumentation-pyramid==0.46b0",
|
142
142
|
},
|
143
143
|
{
|
144
144
|
"library": "redis >= 2.6",
|
145
|
-
"instrumentation": "opentelemetry-instrumentation-redis==0.
|
145
|
+
"instrumentation": "opentelemetry-instrumentation-redis==0.46b0",
|
146
146
|
},
|
147
147
|
{
|
148
148
|
"library": "remoulade >= 0.50",
|
149
|
-
"instrumentation": "opentelemetry-instrumentation-remoulade==0.
|
149
|
+
"instrumentation": "opentelemetry-instrumentation-remoulade==0.46b0",
|
150
150
|
},
|
151
151
|
{
|
152
152
|
"library": "requests ~= 2.0",
|
153
|
-
"instrumentation": "opentelemetry-instrumentation-requests==0.
|
153
|
+
"instrumentation": "opentelemetry-instrumentation-requests==0.46b0",
|
154
154
|
},
|
155
155
|
{
|
156
156
|
"library": "scikit-learn ~= 0.24.0",
|
157
|
-
"instrumentation": "opentelemetry-instrumentation-sklearn==0.
|
157
|
+
"instrumentation": "opentelemetry-instrumentation-sklearn==0.46b0",
|
158
158
|
},
|
159
159
|
{
|
160
160
|
"library": "sqlalchemy",
|
161
|
-
"instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.
|
161
|
+
"instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.46b0",
|
162
162
|
},
|
163
163
|
{
|
164
164
|
"library": "starlette ~= 0.13.0",
|
165
|
-
"instrumentation": "opentelemetry-instrumentation-starlette==0.
|
165
|
+
"instrumentation": "opentelemetry-instrumentation-starlette==0.46b0",
|
166
166
|
},
|
167
167
|
{
|
168
168
|
"library": "psutil >= 5",
|
169
|
-
"instrumentation": "opentelemetry-instrumentation-system-metrics==0.
|
169
|
+
"instrumentation": "opentelemetry-instrumentation-system-metrics==0.46b0",
|
170
170
|
},
|
171
171
|
{
|
172
172
|
"library": "tornado >= 5.1.1",
|
173
|
-
"instrumentation": "opentelemetry-instrumentation-tornado==0.
|
173
|
+
"instrumentation": "opentelemetry-instrumentation-tornado==0.46b0",
|
174
174
|
},
|
175
175
|
{
|
176
176
|
"library": "tortoise-orm >= 0.17.0",
|
177
|
-
"instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.
|
177
|
+
"instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.46b0",
|
178
178
|
},
|
179
179
|
{
|
180
180
|
"library": "pydantic >= 1.10.2",
|
181
|
-
"instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.
|
181
|
+
"instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.46b0",
|
182
182
|
},
|
183
183
|
{
|
184
184
|
"library": "urllib3 >= 1.0.0, < 3.0.0",
|
185
|
-
"instrumentation": "opentelemetry-instrumentation-urllib3==0.
|
185
|
+
"instrumentation": "opentelemetry-instrumentation-urllib3==0.46b0",
|
186
186
|
},
|
187
187
|
]
|
188
188
|
default_instrumentations = [
|
189
|
-
"opentelemetry-instrumentation-asyncio==0.
|
190
|
-
"opentelemetry-instrumentation-aws-lambda==0.
|
191
|
-
"opentelemetry-instrumentation-dbapi==0.
|
192
|
-
"opentelemetry-instrumentation-logging==0.
|
193
|
-
"opentelemetry-instrumentation-sqlite3==0.
|
194
|
-
"opentelemetry-instrumentation-
|
195
|
-
"opentelemetry-instrumentation-
|
189
|
+
"opentelemetry-instrumentation-asyncio==0.46b0",
|
190
|
+
"opentelemetry-instrumentation-aws-lambda==0.46b0",
|
191
|
+
"opentelemetry-instrumentation-dbapi==0.46b0",
|
192
|
+
"opentelemetry-instrumentation-logging==0.46b0",
|
193
|
+
"opentelemetry-instrumentation-sqlite3==0.46b0",
|
194
|
+
"opentelemetry-instrumentation-threading==0.46b0",
|
195
|
+
"opentelemetry-instrumentation-urllib==0.46b0",
|
196
|
+
"opentelemetry-instrumentation-wsgi==0.46b0",
|
196
197
|
]
|
@@ -50,9 +50,10 @@ class BaseDistro(ABC):
|
|
50
50
|
def load_instrumentor( # pylint: disable=no-self-use
|
51
51
|
self, entry_point: EntryPoint, **kwargs
|
52
52
|
):
|
53
|
-
"""Takes
|
54
|
-
and
|
55
|
-
|
53
|
+
"""Takes an instrumentation entry point and activates it by instantiating
|
54
|
+
and calling instrument() on it.
|
55
|
+
This is called for each opentelemetry_instrumentor entry point by auto
|
56
|
+
instrumentation.
|
56
57
|
|
57
58
|
Distros can override this method to customize the behavior by
|
58
59
|
inspecting each entry point and configuring them in special ways,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: opentelemetry-instrumentation
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.46b0
|
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
|
Author-email: OpenTelemetry Authors <cncf-opentelemetry-contributors@lists.cncf.io>
|
@@ -1,20 +1,20 @@
|
|
1
|
-
opentelemetry/instrumentation/_semconv.py,sha256=
|
2
|
-
opentelemetry/instrumentation/bootstrap.py,sha256=
|
3
|
-
opentelemetry/instrumentation/bootstrap_gen.py,sha256=
|
1
|
+
opentelemetry/instrumentation/_semconv.py,sha256=dDNGU4I5r6UvLHWIpwW1eblSGKQCSNghCjsCBwEFsoA,13703
|
2
|
+
opentelemetry/instrumentation/bootstrap.py,sha256=J_sUXmcnUGXXj0ySJ1KxGcr-nmfDP7-S_N3vHqjLecY,4725
|
3
|
+
opentelemetry/instrumentation/bootstrap_gen.py,sha256=6t_k5Hwfgb-MNvusKaOUfNrt90I0ULrEexfcq3znypM,6703
|
4
4
|
opentelemetry/instrumentation/dependencies.py,sha256=ljJ0nMK_vNZXOiCTLOT1nM3xpwmx7LVaW_S53jcRvIY,1798
|
5
|
-
opentelemetry/instrumentation/distro.py,sha256=
|
5
|
+
opentelemetry/instrumentation/distro.py,sha256=vCvt0pHLtL3OF1m7MVyPUkK4UfoZN6-Vj7JCc6XLbwc,2145
|
6
6
|
opentelemetry/instrumentation/environment_variables.py,sha256=oRcbNSSbnqJMQ3r4gBhK6jqtuI5WizapP962Z8DrVZ8,905
|
7
7
|
opentelemetry/instrumentation/instrumentor.py,sha256=0r527qBsl-fPAVXPM3iu_k94omLN5MStOFmuAqpD_Zo,4509
|
8
8
|
opentelemetry/instrumentation/propagators.py,sha256=hBkG70KlMUiTjxPeiyOhkb_eE96DRVzRyY4fEIzMqD4,4070
|
9
9
|
opentelemetry/instrumentation/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
opentelemetry/instrumentation/sqlcommenter_utils.py,sha256=yV_-hcwy_3ckP76_FC2dOrd8IKi9z_9s980ZMuGYkrE,1960
|
11
11
|
opentelemetry/instrumentation/utils.py,sha256=REjbeQl1wE6A4ByCKxOH5xdEjov2FHeO_WEUmGw6wqk,6128
|
12
|
-
opentelemetry/instrumentation/version.py,sha256=
|
12
|
+
opentelemetry/instrumentation/version.py,sha256=asa7q2ly73330-K1Q7vujpvZk7hfhasEZUzSFDPu1N8,608
|
13
13
|
opentelemetry/instrumentation/auto_instrumentation/__init__.py,sha256=en-gz8Qg6JlGR6XnFF0TYBElVUGMGNo3FtnB0GBJfA0,3780
|
14
14
|
opentelemetry/instrumentation/auto_instrumentation/_load.py,sha256=RDFVxFJ2NR02i8_MFc2FJFxRQjsvjX8f1H2N7ZMF5V0,4794
|
15
15
|
opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py,sha256=p3cz9NlKNlnzxc7guFSPyztx8XMUteAxkN1NFYXSH-0,1449
|
16
|
-
opentelemetry_instrumentation-0.
|
17
|
-
opentelemetry_instrumentation-0.
|
18
|
-
opentelemetry_instrumentation-0.
|
19
|
-
opentelemetry_instrumentation-0.
|
20
|
-
opentelemetry_instrumentation-0.
|
16
|
+
opentelemetry_instrumentation-0.46b0.dist-info/METADATA,sha256=HnyH6uUKDWtwFtY55DFfAiuhGfmSVd238C_4afzyQoI,6064
|
17
|
+
opentelemetry_instrumentation-0.46b0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
18
|
+
opentelemetry_instrumentation-0.46b0.dist-info/entry_points.txt,sha256=iVv3t5REB0O58tFUEQQXYLrTCa1VVOFUXfrbvUk6_aU,279
|
19
|
+
opentelemetry_instrumentation-0.46b0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
20
|
+
opentelemetry_instrumentation-0.46b0.dist-info/RECORD,,
|
@@ -186,7 +186,7 @@
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
187
187
|
identification within third-party archives.
|
188
188
|
|
189
|
-
Copyright
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
190
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
192
192
|
you may not use this file except in compliance with the License.
|
File without changes
|