SDK publishes exception segment regardless whether it's handled or not
@wangzlei がすでに取り組んでいます。
2021年3月22日 から。
評価
この issue はまだ評価されていません。
説明
This was originally brought up in https://github.com/awslabs/aws-lambda-powertools-python/issues/334 but @heitorlessa mentioned this is could be an upstream issue here and asked me to file an Issue. The details can be found in the original issue as well but we have the following function in our lambda code:
def get_secrets(secret_name) -> dict:
try:
get_secret_value_response = client.get_secret_value(SecretId=secret_name)
except ClientError as e:
if e.response["Error"]["Code"] == "ResourceNotFoundException":
if "AWSCURRENT" in e.response["Message"]:
logger.warning(f"{secret_name} exists but is empty.")
else:
logger.warning(
f"The requested secret {secret_name} was not found. Create the secret first."
)
return {}
else:
raise RuntimeError("Couldn't retrieve secrets")
else:
return json.loads(get_secret_value_response["SecretString"])
And in our case we continue processing if the secret exists but a value hasn't been set. In this case we're catching and handling the exception, continuing execution. However, the SDK will still flag this as an exception in X-Ray which will show the service as erroring when it actually isn't.
The relevant line is at https://github.com/aws/aws-xray-sdk-python/blob/508f929fee495710656c0c1478f8873a2e9e5666/aws_xray_sdk/core/models/subsegment.py#L70-L78
Is there a way to handle this use case?
- 主要言語
- Python
- スター
- 340
- フォーク
- 148
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aws/aws-xray-sdk-python のほかの issue
-
psycopg connection context manager drops X-Ray tracing wrapper, so cursor execute calls are not traced対応中かも @reginaldalfret が 21 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
aws/aws-xray-sdk-python#490 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
aws/aws-xray-sdk-python#460 ·
-
Next releaseオープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
aws/aws-xray-sdk-python#457 · リアクション 1 件 ·
-
mysql-connector 9.2.0 - TypeError: 'MySQLConnection' object is not iterable対応中かも @reginaldalfret が 21 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
aws/aws-xray-sdk-python#453 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
aws/aws-xray-sdk-python#452 · リアクション 1 件 ·
aws/aws-xray-sdk-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
common-workflow-language/cwl-utils#477 ·
メンテナーはふだん 1 日以内に返信
-
Add dependabotオープンfeat
難易度 2/5 1時間未満 初心者へのやさしさ 72/100
open-nudge/opentemplate#204 ·
メンテナーはふだん 1 日以内に返信
-
github-stale-ci-pr-closer: KV state is double-wrapped, never persists, and hits the depth-32 limit対応中かも @VascoSch92 が今日担当しました。 オープンpriority:medium ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
OpenHands/extensions#781 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
curriculum documentation quality
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
githubnext/gh-aw-workshop#4638 ·
メンテナーはふだん 1 日以内に返信