Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recombine: Multiline golang stack trace example #36275

Open
Fresa opened this issue Nov 8, 2024 · 3 comments
Open

Recombine: Multiline golang stack trace example #36275

Fresa opened this issue Nov 8, 2024 · 3 comments
Labels
enhancement New feature or request needs triage New item requiring triage pkg/stanza

Comments

@Fresa
Copy link

Fresa commented Nov 8, 2024

Component(s)

pkg/stanza

Is your feature request related to a problem? Please describe.

I would like to recombine golang stack traces.

Describe the solution you'd like

The documentation for recombine has an example for how to recombine a java stack trace. Would be great to have something similar for a golang stack trace.

Describe alternatives you've considered

No response

Additional context

No response

@Fresa Fresa added enhancement New feature or request needs triage New item requiring triage labels Nov 8, 2024
Copy link
Contributor

github-actions bot commented Nov 8, 2024

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@VihasMakwana
Copy link
Contributor

Hi.

Can you attach a golang stack trace example? I can help with this.

@Fresa
Copy link
Author

Fresa commented Nov 12, 2024

@VihasMakwana here are two examples, one using zap:
https://go.dev/play/p/fRdYSlGjtUZ

1.257894e+09	error	sandbox3052195497/prog.go:28	stacktrace from panic
main.main.func1
	/tmp/sandbox3052195497/prog.go:28
runtime.gopanic
	/usr/local/go-faketime/src/runtime/panic.go:785
runtime.goPanicIndex
	/usr/local/go-faketime/src/runtime/panic.go:115
main.main
	/tmp/sandbox3052195497/prog.go:34
runtime.main
	/usr/local/go-faketime/src/runtime/proc.go:272

and second one using runtime/debug:
https://go.dev/play/p/krPo2EYA9Iz

stacktrace from panic: goroutine 1 [running]:
runtime/debug.Stack()
	/usr/local/go-faketime/src/runtime/debug/stack.go:26 +0x5e
main.main.func1()
	/tmp/sandbox38606549/prog.go:11 +0x25
panic({0x4a74a0?, 0xc00001a018?})
	/usr/local/go-faketime/src/runtime/panic.go:785 +0x132
main.main()
	/tmp/sandbox38606549/prog.go:16 +0x35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New item requiring triage pkg/stanza
Projects
None yet
Development

No branches or pull requests

2 participants