opentelemetry-instrumentation-botocore 0.43b0__tar.gz → 0.45b0__tar.gz
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_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/PKG-INFO +5 -12
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/pyproject.toml +3 -11
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/src/opentelemetry/instrumentation/botocore/__init__.py +14 -22
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/src/opentelemetry/instrumentation/botocore/version.py +1 -1
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/tests/test_botocore_instrumentation.py +6 -15
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/.gitignore +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/LICENSE +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/README.rst +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/src/opentelemetry/instrumentation/botocore/extensions/__init__.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/src/opentelemetry/instrumentation/botocore/extensions/_messaging.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/src/opentelemetry/instrumentation/botocore/extensions/dynamodb.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/src/opentelemetry/instrumentation/botocore/extensions/lmbd.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/src/opentelemetry/instrumentation/botocore/extensions/sns.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/src/opentelemetry/instrumentation/botocore/extensions/sqs.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/src/opentelemetry/instrumentation/botocore/extensions/types.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/src/opentelemetry/instrumentation/botocore/package.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/tests/__init__.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/tests/test_botocore_dynamodb.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/tests/test_botocore_lambda.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/tests/test_botocore_messaging.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/tests/test_botocore_sns.py +0 -0
- {opentelemetry_instrumentation_botocore-0.43b0 → opentelemetry_instrumentation_botocore-0.45b0}/tests/test_botocore_sqs.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.3
|
2
2
|
Name: opentelemetry-instrumentation-botocore
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.45b0
|
4
4
|
Summary: OpenTelemetry Botocore instrumentation
|
5
5
|
Project-URL: Homepage, https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-botocore
|
6
6
|
Author-email: OpenTelemetry Authors <cncf-opentelemetry-contributors@lists.cncf.io>
|
@@ -11,24 +11,17 @@ Classifier: Intended Audience :: Developers
|
|
11
11
|
Classifier: License :: OSI Approved :: Apache Software License
|
12
12
|
Classifier: Programming Language :: Python
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
14
|
-
Classifier: Programming Language :: Python :: 3.7
|
15
14
|
Classifier: Programming Language :: Python :: 3.8
|
16
15
|
Classifier: Programming Language :: Python :: 3.9
|
17
16
|
Classifier: Programming Language :: Python :: 3.10
|
18
17
|
Classifier: Programming Language :: Python :: 3.11
|
19
|
-
Requires-Python: >=3.
|
18
|
+
Requires-Python: >=3.8
|
20
19
|
Requires-Dist: opentelemetry-api~=1.12
|
21
|
-
Requires-Dist: opentelemetry-instrumentation==0.
|
20
|
+
Requires-Dist: opentelemetry-instrumentation==0.45b0
|
22
21
|
Requires-Dist: opentelemetry-propagator-aws-xray==1.0.1
|
23
|
-
Requires-Dist: opentelemetry-semantic-conventions==0.
|
22
|
+
Requires-Dist: opentelemetry-semantic-conventions==0.45b0
|
24
23
|
Provides-Extra: instruments
|
25
24
|
Requires-Dist: botocore~=1.0; extra == 'instruments'
|
26
|
-
Provides-Extra: test
|
27
|
-
Requires-Dist: botocore<1.31.81,~=1.0; extra == 'test'
|
28
|
-
Requires-Dist: markupsafe==2.0.1; extra == 'test'
|
29
|
-
Requires-Dist: moto[all]~=2.2.6; extra == 'test'
|
30
|
-
Requires-Dist: opentelemetry-instrumentation-botocore[instruments]; extra == 'test'
|
31
|
-
Requires-Dist: opentelemetry-test-utils==0.43b0; extra == 'test'
|
32
25
|
Description-Content-Type: text/x-rst
|
33
26
|
|
34
27
|
OpenTelemetry Botocore Tracing
|
@@ -8,7 +8,7 @@ dynamic = ["version"]
|
|
8
8
|
description = "OpenTelemetry Botocore instrumentation"
|
9
9
|
readme = "README.rst"
|
10
10
|
license = "Apache-2.0"
|
11
|
-
requires-python = ">=3.
|
11
|
+
requires-python = ">=3.8"
|
12
12
|
authors = [
|
13
13
|
{ name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" },
|
14
14
|
]
|
@@ -18,7 +18,6 @@ classifiers = [
|
|
18
18
|
"License :: OSI Approved :: Apache Software License",
|
19
19
|
"Programming Language :: Python",
|
20
20
|
"Programming Language :: Python :: 3",
|
21
|
-
"Programming Language :: Python :: 3.7",
|
22
21
|
"Programming Language :: Python :: 3.8",
|
23
22
|
"Programming Language :: Python :: 3.9",
|
24
23
|
"Programming Language :: Python :: 3.10",
|
@@ -26,8 +25,8 @@ classifiers = [
|
|
26
25
|
]
|
27
26
|
dependencies = [
|
28
27
|
"opentelemetry-api ~= 1.12",
|
29
|
-
"opentelemetry-instrumentation == 0.
|
30
|
-
"opentelemetry-semantic-conventions == 0.
|
28
|
+
"opentelemetry-instrumentation == 0.45b0",
|
29
|
+
"opentelemetry-semantic-conventions == 0.45b0",
|
31
30
|
"opentelemetry-propagator-aws-xray == 1.0.1",
|
32
31
|
]
|
33
32
|
|
@@ -35,13 +34,6 @@ dependencies = [
|
|
35
34
|
instruments = [
|
36
35
|
"botocore ~= 1.0",
|
37
36
|
]
|
38
|
-
test = [
|
39
|
-
"opentelemetry-instrumentation-botocore[instruments]",
|
40
|
-
"markupsafe==2.0.1",
|
41
|
-
"botocore ~= 1.0, < 1.31.81",
|
42
|
-
"moto[all] ~= 2.2.6",
|
43
|
-
"opentelemetry-test-utils == 0.43b0",
|
44
|
-
]
|
45
37
|
|
46
38
|
[project.entry-points.opentelemetry_instrumentor]
|
47
39
|
botocore = "opentelemetry.instrumentation.botocore:BotocoreInstrumentor"
|
@@ -86,10 +86,6 @@ from botocore.endpoint import Endpoint
|
|
86
86
|
from botocore.exceptions import ClientError
|
87
87
|
from wrapt import wrap_function_wrapper
|
88
88
|
|
89
|
-
from opentelemetry import context as context_api
|
90
|
-
|
91
|
-
# FIXME: fix the importing of this private attribute when the location of the _SUPPRESS_HTTP_INSTRUMENTATION_KEY is defined.
|
92
|
-
from opentelemetry.context import _SUPPRESS_HTTP_INSTRUMENTATION_KEY
|
93
89
|
from opentelemetry.instrumentation.botocore.extensions import _find_extension
|
94
90
|
from opentelemetry.instrumentation.botocore.extensions.types import (
|
95
91
|
_AwsSdkCallContext,
|
@@ -98,7 +94,8 @@ from opentelemetry.instrumentation.botocore.package import _instruments
|
|
98
94
|
from opentelemetry.instrumentation.botocore.version import __version__
|
99
95
|
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
100
96
|
from opentelemetry.instrumentation.utils import (
|
101
|
-
|
97
|
+
is_instrumentation_enabled,
|
98
|
+
suppress_http_instrumentation,
|
102
99
|
unwrap,
|
103
100
|
)
|
104
101
|
from opentelemetry.propagators.aws.aws_xray_propagator import AwsXRayPropagator
|
@@ -171,7 +168,7 @@ class BotocoreInstrumentor(BaseInstrumentor):
|
|
171
168
|
|
172
169
|
# pylint: disable=too-many-branches
|
173
170
|
def _patched_api_call(self, original_func, instance, args, kwargs):
|
174
|
-
if
|
171
|
+
if not is_instrumentation_enabled():
|
175
172
|
return original_func(*args, **kwargs)
|
176
173
|
|
177
174
|
call_context = _determine_call_context(instance, args)
|
@@ -200,25 +197,20 @@ class BotocoreInstrumentor(BaseInstrumentor):
|
|
200
197
|
_safe_invoke(extension.before_service_call, span)
|
201
198
|
self._call_request_hook(span, call_context)
|
202
199
|
|
203
|
-
token = context_api.attach(
|
204
|
-
context_api.set_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY, True)
|
205
|
-
)
|
206
|
-
|
207
|
-
result = None
|
208
200
|
try:
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
201
|
+
with suppress_http_instrumentation():
|
202
|
+
result = None
|
203
|
+
try:
|
204
|
+
result = original_func(*args, **kwargs)
|
205
|
+
except ClientError as error:
|
206
|
+
result = getattr(error, "response", None)
|
207
|
+
_apply_response_attributes(span, result)
|
208
|
+
_safe_invoke(extension.on_error, span, error)
|
209
|
+
raise
|
210
|
+
_apply_response_attributes(span, result)
|
211
|
+
_safe_invoke(extension.on_success, span, result)
|
218
212
|
finally:
|
219
|
-
context_api.detach(token)
|
220
213
|
_safe_invoke(extension.after_service_call)
|
221
|
-
|
222
214
|
self._call_response_hook(span, call_context, result)
|
223
215
|
|
224
216
|
return result
|
@@ -27,14 +27,11 @@ from moto import ( # pylint: disable=import-error
|
|
27
27
|
)
|
28
28
|
|
29
29
|
from opentelemetry import trace as trace_api
|
30
|
-
from opentelemetry.context import (
|
31
|
-
_SUPPRESS_HTTP_INSTRUMENTATION_KEY,
|
32
|
-
attach,
|
33
|
-
detach,
|
34
|
-
set_value,
|
35
|
-
)
|
36
30
|
from opentelemetry.instrumentation.botocore import BotocoreInstrumentor
|
37
|
-
from opentelemetry.instrumentation.utils import
|
31
|
+
from opentelemetry.instrumentation.utils import (
|
32
|
+
suppress_http_instrumentation,
|
33
|
+
suppress_instrumentation,
|
34
|
+
)
|
38
35
|
from opentelemetry.propagate import get_global_textmap, set_global_textmap
|
39
36
|
from opentelemetry.propagators.aws.aws_xray_propagator import TRACE_HEADER_KEY
|
40
37
|
from opentelemetry.semconv.trace import SpanAttributes
|
@@ -341,23 +338,17 @@ class TestBotocoreInstrumentor(TestBase):
|
|
341
338
|
@mock_xray
|
342
339
|
def test_suppress_instrumentation_xray_client(self):
|
343
340
|
xray_client = self._make_client("xray")
|
344
|
-
|
345
|
-
try:
|
341
|
+
with suppress_instrumentation():
|
346
342
|
xray_client.put_trace_segments(TraceSegmentDocuments=["str1"])
|
347
343
|
xray_client.put_trace_segments(TraceSegmentDocuments=["str2"])
|
348
|
-
finally:
|
349
|
-
detach(token)
|
350
344
|
self.assertEqual(0, len(self.get_finished_spans()))
|
351
345
|
|
352
346
|
@mock_xray
|
353
347
|
def test_suppress_http_instrumentation_xray_client(self):
|
354
348
|
xray_client = self._make_client("xray")
|
355
|
-
|
356
|
-
try:
|
349
|
+
with suppress_http_instrumentation():
|
357
350
|
xray_client.put_trace_segments(TraceSegmentDocuments=["str1"])
|
358
351
|
xray_client.put_trace_segments(TraceSegmentDocuments=["str2"])
|
359
|
-
finally:
|
360
|
-
detach(token)
|
361
352
|
self.assertEqual(2, len(self.get_finished_spans()))
|
362
353
|
|
363
354
|
@mock_s3
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|