Add ability to capture variables from all frames

Đang mở
#2,002 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
ruby
Lĩnh vực
observability

Hướng nghiên cứu

Bắt đầu với lib/sentry-ruby.rb tại các dòng 57-58, nơi issue cho biết TracePoint lấy binding của các biến cục bộ. Xác định liệu Ruby có thể truy cập binding của mọi frame từ một Exception Handler hay không, sau đó xác định các bài kiểm thử hiện có cho include_local_variables. Hoàn thành nghĩa là một báo cáo opt-in bao gồm các biến từ mọi stack frame mà không thay đổi hành vi hiện tại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Ruby
Star
990
Fork
552
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
29

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/sentry-ruby

Tất cả issue của getsentry/sentry-ruby

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.