SDK publishes exception segment regardless whether it's handled or not
@wangzlei ci sta già lavorando.
Dal 22/3/2021.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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?
- Lingua principale
- Python
- Stelle
- 339
- Fork
- 147
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aws/aws-xray-sdk-python
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
aws/aws-xray-sdk-python#490 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 1/100
aws/aws-xray-sdk-python#460 ·
-
Next releaseAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
aws/aws-xray-sdk-python#457 · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
aws/aws-xray-sdk-python#453 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
aws/aws-xray-sdk-python#452 · 1 reazione ·
Tutte le issue di aws/aws-xray-sdk-python
Issue simili
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
vllm-project/vllm-metal#822 ·
I maintainer di solito rispondono entro 1 giorno
-
vector-store
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
mem0ai/mem0#7461 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: chunk_span_bounds and _validated_chunk_spans reject Pydantic models ChunkSpan and AudioFileAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BasedHardware/omi#19047 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno