Xray not capturing stack traces in latest version of Flask
@srprash ci sta già lavorando.
Dal 26/1/2021.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
The after_request handler is closing the segment before the teardown_request handler is called so the stack trace isn't captured.
It looks like this behavior changed as of Flask v1.1.0 (specifically https://github.com/pallets/flask/pull/3266)
Currently using:
- aws-xray-sdk v2.6.0
- flask v1.1.2
Here is our current work around:
app = Flask(__name__)
def wrap_exception_handler(handler):
def wrapped_function(exp):
if not isinstance(exp, HTTPException) or exp.code >= 500:
try:
stack = stacktrace.get_stacktrace(
limit=xray_recorder.max_trace_back,
)
xray_recorder.current_segment().add_exception(exp, stack)
except Exception:
app.logger.error('Failed to add stack trace to xray segment')
return handler(exp)
return wrapped_function
app.handle_user_exception = wrap_exception_handler(app.handle_user_exception)
- Lingua principale
- Python
- Stelle
- 339
- Fork
- 147
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
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 release Aperta
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
-
bug priority:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
CyberAgent/psd2svg#436 ·
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
NousResearch/hermes-agent#122386 · 1 commento ·
-
ai-generated
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vllm-project/production-stack#1105 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100