Add uninstrument test for aws lambda (#1505)
This commit is contained in:
parent
23f63a5328
commit
a9f34136d2
|
|
@ -379,3 +379,18 @@ class TestAwsLambdaInstrumentor(TestBase):
|
||||||
SpanAttributes.HTTP_USER_AGENT: "agent",
|
SpanAttributes.HTTP_USER_AGENT: "agent",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_uninstrument(self):
|
||||||
|
AwsLambdaInstrumentor().instrument()
|
||||||
|
|
||||||
|
mock_execute_lambda(MOCK_LAMBDA_API_GATEWAY_HTTP_API_EVENT)
|
||||||
|
|
||||||
|
spans = self.memory_exporter.get_finished_spans()
|
||||||
|
self.assertEqual(len(spans), 1)
|
||||||
|
|
||||||
|
self.memory_exporter.clear()
|
||||||
|
AwsLambdaInstrumentor().uninstrument()
|
||||||
|
|
||||||
|
mock_execute_lambda(MOCK_LAMBDA_API_GATEWAY_HTTP_API_EVENT)
|
||||||
|
spans = self.memory_exporter.get_finished_spans()
|
||||||
|
self.assertEqual(len(spans), 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue