Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

changing lambda segment immutability

Aperta
#308 2 commenti 4 reazioni 1 assegnatario Vedi su GitHub

@bhautikpip ci sta già lavorando.

Dal 20/7/2021.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aws/aws-xray-sdk-python

Tutte le issue di aws/aws-xray-sdk-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.