Issue with passing trace_entity when using ThreadPoolExecutor in lambda
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- aws, python
- Ambito
- observability-sre
Direzione di ricerca
Inizia con l'esempio di ThreadPoolExecutor nel README e analizza la classe di contesto personalizzata utilizzata per le lambda, in particolare il modo in cui le entità di traccia vengono inizializzate e impostate. Riproduci il primo job gestito da un thread e verifica che il suo sottosegmento sia associato all'entità di traccia fornita senza bisogno di una chiamata preliminare a get_trace_entity.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I followed the instructions in the readme for passing the trace entity in a ThreadPoolExecutor but this does not appear to work properly in a lambda. The first time a thread does some work the trace_entity does not stick and the subsegment gets put under the root node not the one it should be assiciated with. The next time a thread picks up a job everything seems to operate fine.
I dug into the code a bit and it seems like there is a custome context class for lambdas but it does not override set_trace_entity to work properly with the other changes in the class. To workaround the issue I have found calling get_trace_entity before setting sets the internal state up properly.
example workaround from readme
def load_url(url, trace_entity):
xray_recorder.get_trace_entity() # Workaround to setup internal state
xray_recorder.set_trace_entity(trace_entity)
resp = requests.get(url)
xray_recorder.clear_trace_entities()
return resp
- 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
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
browser-use/browser-use#5905 ·
-
type: enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ynput/ayon-python-api#363 ·
-
bug needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
modelscope/FunASR#3728 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
open-compass/opencompass#2655 ·