sentry icon indicating copy to clipboard operation
sentry copied to clipboard

Display contexts with correct formatting

Open bruno-garcia opened this issue 1 year ago • 2 comments

Events from the .NET SDK (like this) have some data being sent as bytes in integer format:

image

In other parts of the protocol we're able to display it as 'KB, MB, GB etc".

What needs to be done on the SDK to get the data shown properly?

That's happening here in the SDK:

https://github.com/getsentry/sentry-dotnet/blob/717aa7356a1f4bebf4b9379243c05f760b92d613/src/Sentry/Internal/MemoryInfo.cs#L8

https://github.com/getsentry/sentry-dotnet/blob/717aa7356a1f4bebf4b9379243c05f760b92d613/src/Sentry/Internal/MainSentryEventProcessor.cs#L165-L193

bruno-garcia avatar Apr 18 '24 19:04 bruno-garcia

Routing to @getsentry/product-owners-issues for triage ⏲️

getsantry[bot] avatar Oct 04 '24 15:10 getsantry[bot]

cc @rachrwang, a few years ago @matejminar added some formatting, IIRC we have something for other parts of the context part of the protocol like Device.Memory. So I'm hoping this could be an easy fix.

I find it impossible to parse the data the way it looks right now.

This is part of the challenges to debug OOM's on .NET already, tracked here:

  • https://github.com/getsentry/sentry-dotnet/issues/3315

Visualizing the memory info in a more humable readable way will definitely improve things.

bruno-garcia avatar Oct 04 '24 15:10 bruno-garcia

Fixed in https://github.com/getsentry/sentry/pull/80623, wrapped the values in formatMemory!

leeandher avatar Nov 12 '24 22:11 leeandher

Image

So nice to read! thank you @leeandher

bruno-garcia avatar Nov 24 '24 02:11 bruno-garcia