Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

changing lambda segment immutability

Abierto
#308 2 comentarios 4 reacciones 1 asignado Ver en GitHub

@bhautikpip ya está trabajando en esto.

Desde el 20/7/2021.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

enhancement

It would be a nice feature if you had the ability to mutate segments in lambda handlers.

With the immutability limitation, it renders the service map error visibility useless if we're catching all exceptions in our lambda handler but still want to display the exception on the corresponding node in the graph.

For example, lets say you have the following design pattern:

Lambda handler that catches all exceptions and returns a response no matter what, this way, the client is always expecting a response value from the handler, regardless if an exception is raised.

If the segments in lambdas weren't immutable, we could get the current segment from the xray_recorder and call the add_exception method to attach the exception to the segment, thus, reflecting the error on the segment node in the graph.

Right now, all we can do is add the exception to the current subsegment, which still helps when inspecting the trace, but from a visual perspective, the map won't show any errors.

I'm aware of using API gateway with the handler, and returning a 4xx http response when we catch our exception. This improves visibility somewhat, because the client and api gateway nodes flag the errors, but still the lambda node will be healthy.

Also, this forces us to use API gateway to handle this design pattern, which we might not want to use.

We'd really like this change at my place of work for our current use case.

Lenguaje dominante
Python
Estrellas
339
Forks
148
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de aws/aws-xray-sdk-python

Todos los issues de aws/aws-xray-sdk-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.