getsentry / getsentry/sentry-python

ref(boto3): Own one logical botocore client-call lifecycle

Open
#7,474 1 comment 0 reactions 1 assignee Claimed by @pabloDeputter View on GitHub
Python
Dominant language
Python
Stars
2.2k
Forks
669
Avg merge
1d 1h
Merged PRs (30d)
213

Description

### Problem

* spans are currently created in `request-created`. Botocore may emit this during retries; it's also too late to cover any failures during operation lookup, parameter construction, serialization, or other work before an HTTP request exists.

### Proposed Solution

* patch `BaseClient._make_api_call` as [OTel]() does; one logical client span should cover all retries until response, error, or cancellation.
* wrapper is the only owner of the aws client span's start and completion.
* `_AwsCallContext` can be used to contain generic data such botocore client, service name, operation name, region, endpoint URL, etc

#### Sources

* [https://opentelemetry.io/docs/specs/semconv/rpc/rpc-spans/#rpc-client-span]()
* [https://github.com/boto/botocore/blob/develop/botocore/client.py]()
* [https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py]()

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.