|
25 | 25 | from opentelemetry.instrumentation.botocore.extensions.lmbd import _LambdaExtension |
26 | 26 | from opentelemetry.instrumentation.botocore.extensions.sns import _SnsExtension |
27 | 27 | from opentelemetry.instrumentation.botocore.extensions.sqs import _SqsExtension |
28 | | -from opentelemetry.instrumentation.botocore.extensions.types import _AttributeMapT, _AwsSdkExtension, _BotoResultT |
| 28 | +from opentelemetry.instrumentation.botocore.extensions.types import ( |
| 29 | + _AttributeMapT, |
| 30 | + _AwsSdkExtension, |
| 31 | + _BotocoreInstrumentorContext, |
| 32 | + _BotoResultT, |
| 33 | +) |
29 | 34 | from opentelemetry.semconv.trace import SpanAttributes |
30 | 35 | from opentelemetry.trace.span import Span |
31 | 36 |
|
@@ -75,8 +80,8 @@ def patch_extract_attributes(self, attributes: _AttributeMapT): |
75 | 80 |
|
76 | 81 | old_on_success = _LambdaExtension.on_success |
77 | 82 |
|
78 | | - def patch_on_success(self, span: Span, result: _BotoResultT): |
79 | | - old_on_success(self, span, result) |
| 83 | + def patch_on_success(self, span: Span, result: _BotoResultT, instrumentor_context: _BotocoreInstrumentorContext): |
| 84 | + old_on_success(self, span, result, instrumentor_context) |
80 | 85 | lambda_configuration = result.get("Configuration", {}) |
81 | 86 | function_arn = lambda_configuration.get("FunctionArn") |
82 | 87 | if function_arn: |
@@ -180,8 +185,8 @@ def patch_extract_attributes(self, attributes: _AttributeMapT): |
180 | 185 |
|
181 | 186 | old_on_success = _SqsExtension.on_success |
182 | 187 |
|
183 | | - def patch_on_success(self, span: Span, result: _BotoResultT): |
184 | | - old_on_success(self, span, result) |
| 188 | + def patch_on_success(self, span: Span, result: _BotoResultT, instrumentor_context: _BotocoreInstrumentorContext): |
| 189 | + old_on_success(self, span, result, instrumentor_context) |
185 | 190 | queue_url = result.get("QueueUrl") |
186 | 191 | if queue_url: |
187 | 192 | span.set_attribute(AWS_SQS_QUEUE_URL, queue_url) |
@@ -243,7 +248,7 @@ def extract_attributes(self, attributes: _AttributeMapT): |
243 | 248 | attributes[AWS_SECRETSMANAGER_SECRET_ARN] = secret_id |
244 | 249 |
|
245 | 250 | # pylint: disable=no-self-use |
246 | | - def on_success(self, span: Span, result: _BotoResultT): |
| 251 | + def on_success(self, span: Span, result: _BotoResultT, instrumentor_context: _BotocoreInstrumentorContext): |
247 | 252 | secret_arn = result.get("ARN") |
248 | 253 | if secret_arn: |
249 | 254 | span.set_attribute(AWS_SECRETSMANAGER_SECRET_ARN, secret_arn) |
|
0 commit comments