Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

botocore: Add DynamoDB extension #735

Merged
merged 5 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#663](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/663))
- `opentelemetry-instrumentation-botocore` Introduce instrumentation extensions
([#718](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/718))
- `opentelemetry-instrumentation-botocore` Add extension for DynamoDB
([#735](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/735))

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ def _patched_api_call(self, original_func, instance, args, kwargs):
if BotocoreInstrumentor._is_lambda_invoke(call_context):
BotocoreInstrumentor._patch_lambda_invoke(call_context.params)

_set_api_call_attributes(span, call_context)
_safe_invoke(extension.before_service_call, span)
self._call_request_hook(span, call_context)

Expand Down Expand Up @@ -261,14 +260,6 @@ def _call_response_hook(
)


def _set_api_call_attributes(span, call_context: _AwsSdkCallContext):
if not span.is_recording():
return

if "TableName" in call_context.params:
span.set_attribute("aws.table_name", call_context.params["TableName"])


def _apply_response_attributes(span: Span, result):
if result is None or not span.is_recording():
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def loader():


_KNOWN_EXTENSIONS = {
"dynamodb": _lazy_load(".dynamodb", "_DynamoDbExtension"),
"sqs": _lazy_load(".sqs", "_SqsExtension"),
}

Expand Down
Loading