getsentry / sentry-dotnet

Sentry SDK for .NET
https://docs.sentry.io/platforms/dotnet
MIT License
582 stars 207 forks source link

Stack trace contains file without path to project root (or any path) #2105

Closed bruno-garcia closed 1 year ago

bruno-garcia commented 1 year ago

Package

Sentry

.NET Flavor

.NET

.NET Version

7.0.1

OS

Linux

SDK Version

3.24.1

Self-Hosted Sentry Version

No response

Steps to Reproduce

Throw an exception from Program.cs, example:

https://sentry.io/organizations/nugettrends/issues/3821092585/?project=1266317&query=is%3Aunresolved&referrer=issue-stream#context-Current%20Culture

And:

https://sentry.io/organizations/nugettrends/issues/3854515030/?project=1266316&query=is%3Aunresolved&referrer=issue-stream

Expected Result

src/NuGetTrends.Web/Program.cs Or at least NuGetTrends.Web/Program.cs

On GitHub: https://github.com/dotnet/nuget-trends/blob/main/src/NuGetTrends.Web/Program.cs

I want some path in there so I can configure code mappings. And get suspect commits to work.

image

Actual Result

Only the file name is there without any path.

image

mattjohnsonpint commented 1 year ago

What's happening here is that the filename is being stripped of the project path (correctly), but the absolute path is not being sent. Sending abs_path when we truncate the project path will resolve this.