diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/tests/test_boto3sqs_instrumentation.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/tests/test_boto3sqs_instrumentation.py index 102e40693c..a6ca0e062b 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/tests/test_boto3sqs_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/tests/test_boto3sqs_instrumentation.py @@ -311,3 +311,27 @@ def test_receive_message(self): self.assertEqual(attrs["span_id"], link.context.span_id) self.memory_exporter.clear() + + def test_uninstrument(self): + mock_response = { + "MessageId": "123456789", + } + + with self._mocked_endpoint(mock_response): + self._client.send_message( + QueueUrl=self._queue_url, + MessageBody="test", + ) + + spans = self.get_finished_spans() + self.assertEqual(1, len(spans)) + + self.memory_exporter.clear() + Boto3SQSInstrumentor().uninstrument() + + self._client.send_message( + QueueUrl=self._queue_url, + MessageBody="test", + ) + spans = self.get_finished_spans() + self.assertEqual(0, len(spans))