sentry-go icon indicating copy to clipboard operation
sentry-go copied to clipboard

Report more Operating System details such as OS version

Open rhcarvalho opened this issue 5 years ago • 4 comments

Currently the SDK reports the Operating System type taken from runtime.GOOS. It could report more OS details such as version.

The use cases:

  • programs that are distributed to end users and report errors back
  • programs that run on heterogeneous environments (a generalization of the above, but also e.g. a web server running on different types of VMs)

(Extracted from #187)

rhcarvalho avatar Apr 08 '20 10:04 rhcarvalho

gathering os information from uname syscall is enough?

wingyplus avatar Apr 08 '20 10:04 wingyplus

gathering os information from uname syscall is enough?

I believe for Linux/macOS we can read from https://godoc.org/golang.org/x/sys/unix#Utsname And for Windows from https://godoc.org/golang.org/x/sys/windows#OsVersionInfoEx

Haven't tested, but seems your PR is in a good direction 👍

rhcarvalho avatar Apr 14 '20 11:04 rhcarvalho

I’m not familiar it yet about windows os syscall but it’s sound interesting for me to try.

I don’t know how to write unit test for it because it’s depend on os specific, including os version. Do you have any idea about it?

wingyplus avatar Apr 14 '20 15:04 wingyplus

You can use build constraints on test files to run different tests on different OSs. Of course, you then need to run your tests on different OSs so in this case it might be better to just have a few tests with the syscall mocked out.

tylerd-canva avatar Sep 16 '21 06:09 tylerd-canva

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Dec 07 '22 09:12 github-actions[bot]