Add ability to capture variables from all frames

Offen
#2,002 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
ruby
Bereich
observability

Rechercherichtung

Beginne mit lib/sentry-ruby.rb in den Zeilen 57-58, wo im Issue steht, dass TracePoint das binding für lokale Variablen abruft. Ermittle, ob Ruby aus einem Exception-Handler auf bindings für jeden Frame zugreifen kann, und identifiziere anschließend die vorhandenen Tests für include_local_variables. Als abgeschlossen gilt die Aufgabe, wenn ein Opt-in-Report Variablen aus allen Stack-Frames enthält, ohne das aktuelle Verhalten zu ändern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Errors Feature Ruby

Describe the idea
I am currently using the include_local_variables flag to capture the top frame's variables on an exception. AFAIK there isn't support for capturing variables for all frames, only the top frame. I am curious if it is possible to report variables for all frames in the stack as an option as well.

Why do you think it's beneficial to most of the users

In my case, it would help a ton to debug why an error is occurring to understand how to solve it. For example, there is an exception being raised by an HTTP request, but the part I am trying to understand is how that request was constructed, not why the exception was raised when executing that request (the wrong request is being sent).

Screenshot 2023-02-13 at 6 15 27 PM

Possible implementation

I am not sure if this is possible in Ruby!

I see the current implementation gets the binding using TracePoint, and then gets the variables from that.

I don't know in ruby if you can navigate up the stack in an exception handler like this.

Vorherrschende Sprache
Ruby
Sterne
990
Forks
552
Ø Merge
2 T. 16 Std.
Gemergte PRs (30 T.)
29

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus getsentry/sentry-ruby

Alle Issues in getsentry/sentry-ruby

Ähnliche Issues

Weitere Issues zu Ruby

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.