Document how to create new subsegments inside a ThreadPoolExecutor thread
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- aws, python
- Área
- documentation
Línea de trabajo
Comienza con la documentación sobre threading enlazada en el issue y revisa los puntos de entrada capture e in_segment después de set_trace_entity. Aclara el patrón compatible para crear subsegmentos en hilos de trabajo, incluida la limpieza, y actualiza el ejemplo para que el lector pueda distinguir los enfoques válidos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The current documentation shows how to set the parent thread's X-ray entity in the worker thread:
def load_url(url, trace_entity):
# Set the parent X-Ray entity for the worker thread.
xray_recorder.set_trace_entity(trace_entity)
# Subsegment captured from the following HTTP GET will be
# a child of parent entity passed from the main thread.
resp = requests.get(url)
# prevent thread pollution
xray_recorder.clear_trace_entities()
return resp
However it's not clear how this interacts with capture/in_segment. For example, I assume this isn't correct, as the capture starts before we call set_trace_entity:
@xray_recorder.capture('subsegment_name')
def load_url(url, trace_entity):
# Set the parent X-Ray entity for the worker thread.
xray_recorder.set_trace_entity(trace_entity)
# Subsegment captured from the following HTTP GET will be
# a child of parent entity passed from the main thread.
resp = requests.get(url)
# prevent thread pollution
xray_recorder.clear_trace_entities()
return resp
However, are these two OK?
def load_url(url, trace_entity):
# Set the parent X-Ray entity for the worker thread.
xray_recorder.set_trace_entity(trace_entity)
with xray_recorder.capture('subsegment_name'):
# Subsegment captured from the following HTTP GET will be
# a child of parent entity passed from the main thread.
resp = requests.get(url)
# prevent thread pollution
xray_recorder.clear_trace_entities()
return resp
def load_url(url, trace_entity):
# Set the parent X-Ray entity for the worker thread.
xray_recorder.set_trace_entity(trace_entity)
with xray_recorder.in_segment('segment_name') as segment:
segment.put_metadata('key', dict, 'namespace')
# Subsegment captured from the following HTTP GET will be
# a child of parent entity passed from the main thread.
resp = requests.get(url)
# prevent thread pollution
xray_recorder.clear_trace_entities()
return resp
It would be great if the docs on threading had a more complete example.
- Lenguaje dominante
- Python
- Estrellas
- 340
- Forks
- 148
- Merge medio
- 7 d 8 h
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws/aws-xray-sdk-python
-
psycopg connection context manager drops X-Ray tracing wrapper, so cursor execute calls are not tracedPosiblemente ocupada @reginaldalfret la tomó hace 22 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
aws/aws-xray-sdk-python#490 · 1 comentario ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 1/100
aws/aws-xray-sdk-python#460 ·
-
Next releaseAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
aws/aws-xray-sdk-python#457 · 1 reacción ·
-
mysql-connector 9.2.0 - TypeError: 'MySQLConnection' object is not iterablePosiblemente ocupada @reginaldalfret la tomó hace 22 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
aws/aws-xray-sdk-python#453 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
aws/aws-xray-sdk-python#452 · 1 reacción ·
Todos los issues de aws/aws-xray-sdk-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
lidofinance/diffyscan#239 ·
Los mantenedores suelen responder en 1 día
-
docs: the dev-setup table and AGENTS.md name the reviewed_by guard that CI's Changelog job runsAbiertoarea: tools documentation good first issue ready for a contributor
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
eyalgolan/statecraft-israel#873 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
GET rooms API returns 500 due to nonexistent Room.is_active attributePosiblemente ocupada @Mars-60 la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Add cover art to song rowsAbiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 5 días
-
Harmony OPeNDAP SubSetter (HOSS) Geographic production rssmif16d 7 XYZ_PROV
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
nasa/harmony-autotester#341 ·