getsentry / getsentry/sentry

[feature] optional (and perhaps by default) absolute paths in raw stack traces (ruby)

Open
#77,320 23 comments 0 reactions 0 assignees View on GitHub
Feature
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
22h 21m
Merged PRs (30d)
586

Description

### Problem Statement

Currently paths in the "raw" stack trace shown in the portal look like this:

```
Mysql2::Error: Deadlock found when trying to get lock; try restarting transaction
from mysql2/client.rb:131:in `_query'
from mysql2/client.rb:131:in `block in query'
from mysql2/client.rb:130:in `handle_interrupt'
from mysql2/client.rb:130:in `query'
from active_record/connection_adapters/abstract_mysql_adapter.rb:187:in `block (2 levels) in execute'
from active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
from active_support/concurrency/share_lock.rb:187:in `yield_shares'
from active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
from active_record/connection_adapters/abstract_mysql_adapter.rb:186:in `block in execute'
from active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'
```

Far too much is stripped from the path, most notably the gem folder. Internal paths within a gem won't necessarily identify the gem and aren't necessarily unique across all gems. This makes it difficult to navigate these paths locally when investigating sentry reported exceptions.

Also these paths can't be considered "raw" since the actual original/raw paths in ruby exceptions are absolute.

### Solution Brainstorm

Since you already collect absolute paths and they are definitely useful for precisely identifying and navigating the file in the frame, there should be an option to show absolute paths in the raw stack trace:

![Image](https://github.com/user-attachments/assets/e8ec382a-ccd5-4aa3-892d-b9cb870d725e)

You could add a toggle for absolute paths in this popup or the toolbar above it.

I'd argue that "raw" stack traces should have absolute paths by default since they are the original/raw paths.

### Product Area

Issues

Contributor guide

Open the contributing guide

Research direction

Start by locating the portal's raw stack trace view and the code that formats Ruby frame paths; the issue names no files or tests. Done should provide an absolute-path option with an agreed default and verify that displayed paths preserve the collected full paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.