Abs_path ignored in stack-trace frames?


#1

The documentation describes an abs_path attribute, in addition to the filename attribute.

I’ve added a the abs_path attribute, and this is ingested (by the hosted version of Sentry) without warnings - and appears in the ingested raw JSON as well, for example:

                        {
                            "filename": "test.php",
                            "abs_path": "/mnt/c/workspace/test/kodus-sentry/test.php",
                            "function": "run",
                            "lineno": 455,
                            "context_line": "exit(run());",
                            "pre_context": [
                                "            }",
                                "        }",
                                "    }",
                                ");",
                                ""
                            ],
                            "post_context": [
                                ""
                            ]
                        },

But the absolute path isn’t visible anywhere in the UI?

Tried hovering over the exception filename, and it doesn’t expand.

Even when switching to the “raw” view, the absolute paths are not displayed:

RuntimeException: boom
#4 test.php(365): null
#3 {no file}(null): {closure}
#2 vendor/mindplay/testies/src/TestDriver.php(155): call_user_func
#1 vendor/mindplay/testies/header.php(34): mindplay\testies\TestDriver->run
#0 test.php(455): run

What gives?


#2
  • If you’re asking how this field is used, it’s used for suspected commits, at least. I think there are some other features that we developed halfway but never really got into a useful state. Generally it’s useful information to have, should we ever want to show it in the UI. IMO it’s useful already just because you can query it via the API for stuff like this, though that extension was just an experiment and shouldn’t be considered part of our product.
  • If you’re asking why this isn’t shown directly in the UI, I don’t really have an answer for that :slight_smile: I guess it’s considered not much more useful at a glance than filename, pre_context and post_context combined.

#3

Thank you for that explanation.

Makes sense, except for the bit about why it’s not displayed - in multi-server environments, the full path is pretty important, as it keeps you from wasting time looking at the wrong deployment of apps with similar components.

It’s an easy mistake to make - “oh, I thought it was this installation, not that one”

While not more useful than filename at a glance, I definitely think it’s important?


#4

BTW, I just saw in your OP that PHP does indeed just show the basename… other SDKs show the path relative to the import path. Might be worth filing against the PHP SDK. Here is how it looks in Python:

mymodule/foo/bar.py

This is not an absolute path and yet it’s not just bar.py either.