opentelemetry-instrumentation-botocore 0.46b0__tar.gz → 0.48b0__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.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/.gitignore +3 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/PKG-INFO +5 -4
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/pyproject.toml +4 -3
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/src/opentelemetry/instrumentation/botocore/version.py +1 -1
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/tests/test_botocore_dynamodb.py +32 -16
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/tests/test_botocore_instrumentation.py +27 -35
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/tests/test_botocore_lambda.py +4 -4
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/tests/test_botocore_sns.py +5 -5
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/tests/test_botocore_sqs.py +5 -5
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/LICENSE +0 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/README.rst +0 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/src/opentelemetry/instrumentation/botocore/__init__.py +0 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/src/opentelemetry/instrumentation/botocore/extensions/__init__.py +0 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/src/opentelemetry/instrumentation/botocore/extensions/_messaging.py +0 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/src/opentelemetry/instrumentation/botocore/extensions/dynamodb.py +0 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/src/opentelemetry/instrumentation/botocore/extensions/lmbd.py +0 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/src/opentelemetry/instrumentation/botocore/extensions/sns.py +0 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/src/opentelemetry/instrumentation/botocore/extensions/sqs.py +0 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/src/opentelemetry/instrumentation/botocore/extensions/types.py +0 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/src/opentelemetry/instrumentation/botocore/package.py +0 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/tests/__init__.py +0 -0
- {opentelemetry_instrumentation_botocore-0.46b0 → opentelemetry_instrumentation_botocore-0.48b0}/tests/test_botocore_messaging.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: opentelemetry-instrumentation-botocore
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.48b0
|
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>
|
@@ -15,11 +15,12 @@ Classifier: Programming Language :: Python :: 3.8
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.9
|
16
16
|
Classifier: Programming Language :: Python :: 3.10
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
18
19
|
Requires-Python: >=3.8
|
19
20
|
Requires-Dist: opentelemetry-api~=1.12
|
20
|
-
Requires-Dist: opentelemetry-instrumentation==0.
|
21
|
-
Requires-Dist: opentelemetry-propagator-aws-xray
|
22
|
-
Requires-Dist: opentelemetry-semantic-conventions==0.
|
21
|
+
Requires-Dist: opentelemetry-instrumentation==0.48b0
|
22
|
+
Requires-Dist: opentelemetry-propagator-aws-xray~=1.0.1
|
23
|
+
Requires-Dist: opentelemetry-semantic-conventions==0.48b0
|
23
24
|
Provides-Extra: instruments
|
24
25
|
Requires-Dist: botocore~=1.0; extra == 'instruments'
|
25
26
|
Description-Content-Type: text/x-rst
|
@@ -22,12 +22,13 @@ classifiers = [
|
|
22
22
|
"Programming Language :: Python :: 3.9",
|
23
23
|
"Programming Language :: Python :: 3.10",
|
24
24
|
"Programming Language :: Python :: 3.11",
|
25
|
+
"Programming Language :: Python :: 3.12",
|
25
26
|
]
|
26
27
|
dependencies = [
|
27
28
|
"opentelemetry-api ~= 1.12",
|
28
|
-
"opentelemetry-instrumentation == 0.
|
29
|
-
"opentelemetry-semantic-conventions == 0.
|
30
|
-
"opentelemetry-propagator-aws-xray
|
29
|
+
"opentelemetry-instrumentation == 0.48b0",
|
30
|
+
"opentelemetry-semantic-conventions == 0.48b0",
|
31
|
+
"opentelemetry-propagator-aws-xray ~= 1.0.1",
|
31
32
|
]
|
32
33
|
|
33
34
|
[project.optional-dependencies]
|
@@ -16,7 +16,7 @@ import json
|
|
16
16
|
from unittest import mock
|
17
17
|
|
18
18
|
import botocore.session
|
19
|
-
from moto import
|
19
|
+
from moto import mock_aws # pylint: disable=import-error
|
20
20
|
|
21
21
|
from opentelemetry.instrumentation.botocore import BotocoreInstrumentor
|
22
22
|
from opentelemetry.instrumentation.botocore.extensions.dynamodb import (
|
@@ -184,7 +184,7 @@ class TestDynamoDbExtension(TestBase):
|
|
184
184
|
)
|
185
185
|
self.assert_item_col_metrics(span)
|
186
186
|
|
187
|
-
@
|
187
|
+
@mock_aws
|
188
188
|
def test_batch_get_item(self):
|
189
189
|
table_name1 = "test_table1"
|
190
190
|
table_name2 = "test_table2"
|
@@ -203,7 +203,7 @@ class TestDynamoDbExtension(TestBase):
|
|
203
203
|
self.assert_table_names(span, table_name1, table_name2)
|
204
204
|
self.assert_consumed_capacity(span, table_name1, table_name2)
|
205
205
|
|
206
|
-
@
|
206
|
+
@mock_aws
|
207
207
|
def test_batch_write_item(self):
|
208
208
|
table_name1 = "test_table1"
|
209
209
|
table_name2 = "test_table2"
|
@@ -224,7 +224,7 @@ class TestDynamoDbExtension(TestBase):
|
|
224
224
|
self.assert_consumed_capacity(span, table_name1, table_name2)
|
225
225
|
self.assert_item_col_metrics(span)
|
226
226
|
|
227
|
-
@
|
227
|
+
@mock_aws
|
228
228
|
def test_create_table(self):
|
229
229
|
local_sec_idx = {
|
230
230
|
"IndexName": "local_sec_idx",
|
@@ -268,7 +268,7 @@ class TestDynamoDbExtension(TestBase):
|
|
268
268
|
)
|
269
269
|
self.assert_provisioned_read_cap(span, 42)
|
270
270
|
|
271
|
-
@
|
271
|
+
@mock_aws
|
272
272
|
def test_delete_item(self):
|
273
273
|
self._create_prepared_table()
|
274
274
|
|
@@ -297,7 +297,7 @@ class TestDynamoDbExtension(TestBase):
|
|
297
297
|
def test_delete_item_item_collection_metrics(self):
|
298
298
|
self.assert_extension_item_col_metrics("DeleteItem")
|
299
299
|
|
300
|
-
@
|
300
|
+
@mock_aws
|
301
301
|
def test_delete_table(self):
|
302
302
|
self._create_prepared_table()
|
303
303
|
|
@@ -306,7 +306,7 @@ class TestDynamoDbExtension(TestBase):
|
|
306
306
|
span = self.assert_span("DeleteTable")
|
307
307
|
self.assert_table_names(span, self.default_table_name)
|
308
308
|
|
309
|
-
@
|
309
|
+
@mock_aws
|
310
310
|
def test_describe_table(self):
|
311
311
|
self._create_prepared_table()
|
312
312
|
|
@@ -315,15 +315,31 @@ class TestDynamoDbExtension(TestBase):
|
|
315
315
|
span = self.assert_span("DescribeTable")
|
316
316
|
self.assert_table_names(span, self.default_table_name)
|
317
317
|
|
318
|
-
@
|
319
|
-
def
|
318
|
+
@mock_aws
|
319
|
+
def test_get_item_expression(self):
|
320
|
+
self._create_prepared_table()
|
321
|
+
|
322
|
+
self.client.get_item(
|
323
|
+
TableName=self.default_table_name,
|
324
|
+
Key={"id": {"S": "1"}},
|
325
|
+
ConsistentRead=True,
|
326
|
+
ProjectionExpression="PE",
|
327
|
+
ReturnConsumedCapacity="TOTAL",
|
328
|
+
)
|
329
|
+
|
330
|
+
span = self.assert_span("GetItem")
|
331
|
+
self.assert_table_names(span, self.default_table_name)
|
332
|
+
self.assert_consistent_read(span, True)
|
333
|
+
self.assert_consumed_capacity(span, self.default_table_name)
|
334
|
+
|
335
|
+
@mock_aws
|
336
|
+
def test_get_item_non_expression(self):
|
320
337
|
self._create_prepared_table()
|
321
338
|
|
322
339
|
self.client.get_item(
|
323
340
|
TableName=self.default_table_name,
|
324
341
|
Key={"id": {"S": "1"}},
|
325
342
|
ConsistentRead=True,
|
326
|
-
AttributesToGet=["id"],
|
327
343
|
ProjectionExpression="PE",
|
328
344
|
ReturnConsumedCapacity="TOTAL",
|
329
345
|
)
|
@@ -334,7 +350,7 @@ class TestDynamoDbExtension(TestBase):
|
|
334
350
|
self.assert_projection(span, "PE")
|
335
351
|
self.assert_consumed_capacity(span, self.default_table_name)
|
336
352
|
|
337
|
-
@
|
353
|
+
@mock_aws
|
338
354
|
def test_list_tables(self):
|
339
355
|
self._create_table(TableName="my_table")
|
340
356
|
self._create_prepared_table()
|
@@ -351,7 +367,7 @@ class TestDynamoDbExtension(TestBase):
|
|
351
367
|
)
|
352
368
|
self.assertEqual(5, span.attributes[SpanAttributes.AWS_DYNAMODB_LIMIT])
|
353
369
|
|
354
|
-
@
|
370
|
+
@mock_aws
|
355
371
|
def test_put_item(self):
|
356
372
|
table = "test_table"
|
357
373
|
self._create_prepared_table(TableName=table)
|
@@ -372,7 +388,7 @@ class TestDynamoDbExtension(TestBase):
|
|
372
388
|
def test_put_item_item_collection_metrics(self):
|
373
389
|
self.assert_extension_item_col_metrics("PutItem")
|
374
390
|
|
375
|
-
@
|
391
|
+
@mock_aws
|
376
392
|
def test_query(self):
|
377
393
|
self._create_prepared_table()
|
378
394
|
|
@@ -407,7 +423,7 @@ class TestDynamoDbExtension(TestBase):
|
|
407
423
|
self.assert_select(span, "ALL_ATTRIBUTES")
|
408
424
|
self.assert_consumed_capacity(span, self.default_table_name)
|
409
425
|
|
410
|
-
@
|
426
|
+
@mock_aws
|
411
427
|
def test_scan(self):
|
412
428
|
self._create_prepared_table()
|
413
429
|
|
@@ -444,7 +460,7 @@ class TestDynamoDbExtension(TestBase):
|
|
444
460
|
self.assert_select(span, "ALL_ATTRIBUTES")
|
445
461
|
self.assert_consumed_capacity(span, self.default_table_name)
|
446
462
|
|
447
|
-
@
|
463
|
+
@mock_aws
|
448
464
|
def test_update_item(self):
|
449
465
|
self._create_prepared_table()
|
450
466
|
|
@@ -465,7 +481,7 @@ class TestDynamoDbExtension(TestBase):
|
|
465
481
|
def test_update_item_item_collection_metrics(self):
|
466
482
|
self.assert_extension_item_col_metrics("UpdateItem")
|
467
483
|
|
468
|
-
@
|
484
|
+
@mock_aws
|
469
485
|
def test_update_table(self):
|
470
486
|
self._create_prepared_table()
|
471
487
|
|
@@ -12,19 +12,11 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
import json
|
15
|
-
from unittest.mock import Mock, patch
|
15
|
+
from unittest.mock import ANY, Mock, patch
|
16
16
|
|
17
17
|
import botocore.session
|
18
18
|
from botocore.exceptions import ParamValidationError
|
19
|
-
from moto import
|
20
|
-
mock_ec2,
|
21
|
-
mock_kinesis,
|
22
|
-
mock_kms,
|
23
|
-
mock_s3,
|
24
|
-
mock_sqs,
|
25
|
-
mock_sts,
|
26
|
-
mock_xray,
|
27
|
-
)
|
19
|
+
from moto import mock_aws # pylint: disable=import-error
|
28
20
|
|
29
21
|
from opentelemetry import trace as trace_api
|
30
22
|
from opentelemetry.instrumentation.botocore import BotocoreInstrumentor
|
@@ -39,7 +31,7 @@ from opentelemetry.test.mock_textmap import MockTextMapPropagator
|
|
39
31
|
from opentelemetry.test.test_base import TestBase
|
40
32
|
from opentelemetry.trace.span import format_span_id, format_trace_id
|
41
33
|
|
42
|
-
_REQUEST_ID_REGEX_MATCH = r"[A-
|
34
|
+
_REQUEST_ID_REGEX_MATCH = r"[A-Za-z0-9]{52}"
|
43
35
|
|
44
36
|
|
45
37
|
# pylint:disable=too-many-public-methods
|
@@ -102,7 +94,7 @@ class TestBotocoreInstrumentor(TestBase):
|
|
102
94
|
self.assertEqual(f"{service}.{operation}", span.name)
|
103
95
|
return span
|
104
96
|
|
105
|
-
@
|
97
|
+
@mock_aws
|
106
98
|
def test_traced_client(self):
|
107
99
|
ec2 = self._make_client("ec2")
|
108
100
|
|
@@ -111,7 +103,7 @@ class TestBotocoreInstrumentor(TestBase):
|
|
111
103
|
request_id = "fdcdcab1-ae5c-489e-9c33-4637c5dda355"
|
112
104
|
self.assert_span("EC2", "DescribeInstances", request_id=request_id)
|
113
105
|
|
114
|
-
@
|
106
|
+
@mock_aws
|
115
107
|
def test_not_recording(self):
|
116
108
|
mock_tracer = Mock()
|
117
109
|
mock_span = Mock()
|
@@ -126,7 +118,7 @@ class TestBotocoreInstrumentor(TestBase):
|
|
126
118
|
self.assertFalse(mock_span.set_attribute.called)
|
127
119
|
self.assertFalse(mock_span.set_status.called)
|
128
120
|
|
129
|
-
@
|
121
|
+
@mock_aws
|
130
122
|
def test_exception(self):
|
131
123
|
s3 = self._make_client("s3")
|
132
124
|
|
@@ -149,14 +141,14 @@ class TestBotocoreInstrumentor(TestBase):
|
|
149
141
|
self.assertIn(SpanAttributes.EXCEPTION_TYPE, event.attributes)
|
150
142
|
self.assertIn(SpanAttributes.EXCEPTION_MESSAGE, event.attributes)
|
151
143
|
|
152
|
-
@
|
144
|
+
@mock_aws
|
153
145
|
def test_s3_client(self):
|
154
146
|
s3 = self._make_client("s3")
|
155
147
|
|
156
148
|
s3.list_buckets()
|
157
149
|
self.assert_span("S3", "ListBuckets")
|
158
150
|
|
159
|
-
@
|
151
|
+
@mock_aws
|
160
152
|
def test_s3_put(self):
|
161
153
|
s3 = self._make_client("s3")
|
162
154
|
|
@@ -174,7 +166,7 @@ class TestBotocoreInstrumentor(TestBase):
|
|
174
166
|
s3.get_object(Bucket="mybucket", Key="foo")
|
175
167
|
self.assert_span("S3", "GetObject", request_id=_REQUEST_ID_REGEX_MATCH)
|
176
168
|
|
177
|
-
@
|
169
|
+
@mock_aws
|
178
170
|
def test_sqs_client(self):
|
179
171
|
sqs = self._make_client("sqs")
|
180
172
|
|
@@ -184,7 +176,7 @@ class TestBotocoreInstrumentor(TestBase):
|
|
184
176
|
"SQS", "ListQueues", request_id=_REQUEST_ID_REGEX_MATCH
|
185
177
|
)
|
186
178
|
|
187
|
-
@
|
179
|
+
@mock_aws
|
188
180
|
def test_sqs_send_message(self):
|
189
181
|
sqs = self._make_client("sqs")
|
190
182
|
test_queue_name = "test_queue_name"
|
@@ -205,14 +197,14 @@ class TestBotocoreInstrumentor(TestBase):
|
|
205
197
|
attributes={"aws.queue_url": queue_url},
|
206
198
|
)
|
207
199
|
|
208
|
-
@
|
200
|
+
@mock_aws
|
209
201
|
def test_kinesis_client(self):
|
210
202
|
kinesis = self._make_client("kinesis")
|
211
203
|
|
212
204
|
kinesis.list_streams()
|
213
205
|
self.assert_span("Kinesis", "ListStreams")
|
214
206
|
|
215
|
-
@
|
207
|
+
@mock_aws
|
216
208
|
def test_unpatch(self):
|
217
209
|
kinesis = self._make_client("kinesis")
|
218
210
|
|
@@ -221,7 +213,7 @@ class TestBotocoreInstrumentor(TestBase):
|
|
221
213
|
kinesis.list_streams()
|
222
214
|
self.assertEqual(0, len(self.memory_exporter.get_finished_spans()))
|
223
215
|
|
224
|
-
@
|
216
|
+
@mock_aws
|
225
217
|
def test_uninstrument_does_not_inject_headers(self):
|
226
218
|
headers = {}
|
227
219
|
|
@@ -240,7 +232,7 @@ class TestBotocoreInstrumentor(TestBase):
|
|
240
232
|
|
241
233
|
self.assertNotIn(TRACE_HEADER_KEY, headers)
|
242
234
|
|
243
|
-
@
|
235
|
+
@mock_aws
|
244
236
|
def test_double_patch(self):
|
245
237
|
sqs = self._make_client("sqs")
|
246
238
|
|
@@ -252,19 +244,19 @@ class TestBotocoreInstrumentor(TestBase):
|
|
252
244
|
"SQS", "ListQueues", request_id=_REQUEST_ID_REGEX_MATCH
|
253
245
|
)
|
254
246
|
|
255
|
-
@
|
247
|
+
@mock_aws
|
256
248
|
def test_kms_client(self):
|
257
249
|
kms = self._make_client("kms")
|
258
250
|
|
259
251
|
kms.list_keys(Limit=21)
|
260
252
|
|
261
253
|
span = self.assert_only_span()
|
254
|
+
expected = self._default_span_attributes("KMS", "ListKeys")
|
255
|
+
expected["aws.request_id"] = ANY
|
262
256
|
# check for exact attribute set to make sure not to leak any kms secrets
|
263
|
-
self.assertEqual(
|
264
|
-
self._default_span_attributes("KMS", "ListKeys"), span.attributes
|
265
|
-
)
|
257
|
+
self.assertEqual(expected, dict(span.attributes))
|
266
258
|
|
267
|
-
@
|
259
|
+
@mock_aws
|
268
260
|
def test_sts_client(self):
|
269
261
|
sts = self._make_client("sts")
|
270
262
|
|
@@ -272,11 +264,11 @@ class TestBotocoreInstrumentor(TestBase):
|
|
272
264
|
|
273
265
|
span = self.assert_only_span()
|
274
266
|
expected = self._default_span_attributes("STS", "GetCallerIdentity")
|
275
|
-
expected["aws.request_id"] =
|
267
|
+
expected["aws.request_id"] = ANY
|
276
268
|
# check for exact attribute set to make sure not to leak any sts secrets
|
277
|
-
self.assertEqual(expected, span.attributes)
|
269
|
+
self.assertEqual(expected, dict(span.attributes))
|
278
270
|
|
279
|
-
@
|
271
|
+
@mock_aws
|
280
272
|
def test_propagator_injects_into_request(self):
|
281
273
|
headers = {}
|
282
274
|
previous_propagator = get_global_textmap()
|
@@ -316,7 +308,7 @@ class TestBotocoreInstrumentor(TestBase):
|
|
316
308
|
finally:
|
317
309
|
set_global_textmap(previous_propagator)
|
318
310
|
|
319
|
-
@
|
311
|
+
@mock_aws
|
320
312
|
def test_override_xray_propagator_injects_into_request(self):
|
321
313
|
headers = {}
|
322
314
|
|
@@ -335,7 +327,7 @@ class TestBotocoreInstrumentor(TestBase):
|
|
335
327
|
self.assertNotIn(MockTextMapPropagator.TRACE_ID_KEY, headers)
|
336
328
|
self.assertNotIn(MockTextMapPropagator.SPAN_ID_KEY, headers)
|
337
329
|
|
338
|
-
@
|
330
|
+
@mock_aws
|
339
331
|
def test_suppress_instrumentation_xray_client(self):
|
340
332
|
xray_client = self._make_client("xray")
|
341
333
|
with suppress_instrumentation():
|
@@ -343,7 +335,7 @@ class TestBotocoreInstrumentor(TestBase):
|
|
343
335
|
xray_client.put_trace_segments(TraceSegmentDocuments=["str2"])
|
344
336
|
self.assertEqual(0, len(self.get_finished_spans()))
|
345
337
|
|
346
|
-
@
|
338
|
+
@mock_aws
|
347
339
|
def test_suppress_http_instrumentation_xray_client(self):
|
348
340
|
xray_client = self._make_client("xray")
|
349
341
|
with suppress_http_instrumentation():
|
@@ -351,7 +343,7 @@ class TestBotocoreInstrumentor(TestBase):
|
|
351
343
|
xray_client.put_trace_segments(TraceSegmentDocuments=["str2"])
|
352
344
|
self.assertEqual(2, len(self.get_finished_spans()))
|
353
345
|
|
354
|
-
@
|
346
|
+
@mock_aws
|
355
347
|
def test_request_hook(self):
|
356
348
|
request_hook_service_attribute_name = "request_hook.service_name"
|
357
349
|
request_hook_operation_attribute_name = "request_hook.operation_name"
|
@@ -386,7 +378,7 @@ class TestBotocoreInstrumentor(TestBase):
|
|
386
378
|
},
|
387
379
|
)
|
388
380
|
|
389
|
-
@
|
381
|
+
@mock_aws
|
390
382
|
def test_response_hook(self):
|
391
383
|
response_hook_service_attribute_name = "request_hook.service_name"
|
392
384
|
response_hook_operation_attribute_name = "response_hook.operation_name"
|
@@ -19,7 +19,7 @@ import zipfile
|
|
19
19
|
from unittest import mock
|
20
20
|
|
21
21
|
import botocore.session
|
22
|
-
from moto import
|
22
|
+
from moto import mock_aws # pylint: disable=import-error
|
23
23
|
from pytest import mark
|
24
24
|
|
25
25
|
from opentelemetry.instrumentation.botocore import BotocoreInstrumentor
|
@@ -96,12 +96,12 @@ class TestLambdaExtension(TestBase):
|
|
96
96
|
mock_call_context = mock.MagicMock(operation=operation, params={})
|
97
97
|
return _LambdaExtension(mock_call_context)
|
98
98
|
|
99
|
-
@
|
99
|
+
@mock_aws
|
100
100
|
def test_list_functions(self):
|
101
101
|
self.client.list_functions()
|
102
102
|
self.assert_span("ListFunctions")
|
103
103
|
|
104
|
-
@
|
104
|
+
@mock_aws
|
105
105
|
def _create_role_and_get_arn(self) -> str:
|
106
106
|
return self.iam_client.create_role(
|
107
107
|
RoleName="my-role",
|
@@ -131,7 +131,7 @@ class TestLambdaExtension(TestBase):
|
|
131
131
|
sys.platform == "win32",
|
132
132
|
reason="requires docker and Github CI Windows does not have docker installed by default",
|
133
133
|
)
|
134
|
-
@
|
134
|
+
@mock_aws
|
135
135
|
def test_invoke(self):
|
136
136
|
previous_propagator = get_global_textmap()
|
137
137
|
try:
|
@@ -18,7 +18,7 @@ from unittest import mock
|
|
18
18
|
|
19
19
|
import botocore.session
|
20
20
|
from botocore.awsrequest import AWSResponse
|
21
|
-
from moto import
|
21
|
+
from moto import mock_aws
|
22
22
|
|
23
23
|
from opentelemetry.instrumentation.botocore import BotocoreInstrumentor
|
24
24
|
from opentelemetry.semconv.trace import (
|
@@ -91,11 +91,11 @@ class TestSnsExtension(TestBase):
|
|
91
91
|
self.assertEqual(span_context.trace_id, int(trace_parent[1], 16))
|
92
92
|
self.assertEqual(span_context.span_id, int(trace_parent[2], 16))
|
93
93
|
|
94
|
-
@
|
94
|
+
@mock_aws
|
95
95
|
def test_publish_to_topic_arn(self):
|
96
96
|
self._test_publish_to_arn("TopicArn")
|
97
97
|
|
98
|
-
@
|
98
|
+
@mock_aws
|
99
99
|
def test_publish_to_target_arn(self):
|
100
100
|
self._test_publish_to_arn("TargetArn")
|
101
101
|
|
@@ -125,7 +125,7 @@ class TestSnsExtension(TestBase):
|
|
125
125
|
span.attributes["messaging.destination.name"],
|
126
126
|
)
|
127
127
|
|
128
|
-
@
|
128
|
+
@mock_aws
|
129
129
|
def test_publish_to_phone_number(self):
|
130
130
|
phone_number = "+10000000000"
|
131
131
|
self.client.publish(
|
@@ -138,7 +138,7 @@ class TestSnsExtension(TestBase):
|
|
138
138
|
phone_number, span.attributes[SpanAttributes.MESSAGING_DESTINATION]
|
139
139
|
)
|
140
140
|
|
141
|
-
@
|
141
|
+
@mock_aws
|
142
142
|
def test_publish_injects_span(self):
|
143
143
|
message_attrs = {}
|
144
144
|
topic_arn = self._create_topic()
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import botocore.session
|
2
|
-
from moto import
|
2
|
+
from moto import mock_aws
|
3
3
|
|
4
4
|
from opentelemetry.instrumentation.botocore import BotocoreInstrumentor
|
5
5
|
from opentelemetry.semconv.trace import SpanAttributes
|
@@ -22,7 +22,7 @@ class TestSqsExtension(TestBase):
|
|
22
22
|
super().tearDown()
|
23
23
|
BotocoreInstrumentor().uninstrument()
|
24
24
|
|
25
|
-
@
|
25
|
+
@mock_aws
|
26
26
|
def test_sqs_messaging_send_message(self):
|
27
27
|
create_queue_result = self.client.create_queue(
|
28
28
|
QueueName="test_queue_name"
|
@@ -51,7 +51,7 @@ class TestSqsExtension(TestBase):
|
|
51
51
|
response["MessageId"],
|
52
52
|
)
|
53
53
|
|
54
|
-
@
|
54
|
+
@mock_aws
|
55
55
|
def test_sqs_messaging_send_message_batch(self):
|
56
56
|
create_queue_result = self.client.create_queue(
|
57
57
|
QueueName="test_queue_name"
|
@@ -85,7 +85,7 @@ class TestSqsExtension(TestBase):
|
|
85
85
|
response["Successful"][0]["MessageId"],
|
86
86
|
)
|
87
87
|
|
88
|
-
@
|
88
|
+
@mock_aws
|
89
89
|
def test_sqs_messaging_receive_message(self):
|
90
90
|
create_queue_result = self.client.create_queue(
|
91
91
|
QueueName="test_queue_name"
|
@@ -116,7 +116,7 @@ class TestSqsExtension(TestBase):
|
|
116
116
|
message_result["Messages"][0]["MessageId"],
|
117
117
|
)
|
118
118
|
|
119
|
-
@
|
119
|
+
@mock_aws
|
120
120
|
def test_sqs_messaging_failed_operation(self):
|
121
121
|
with self.assertRaises(Exception):
|
122
122
|
self.client.send_message(
|
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
|