Skip to content

Conversation

@vatine
Copy link
Contributor

@vatine vatine commented Jan 15, 2019

Fixes #50.

When doing a test deployment of a fluentd container with this plugin baked in, I tried figuring out the correct configuration by spinning up a Go http server with a URL triggering a panic. It did take me quite a while to figure out why my panic stack traces were not being merged.

This PR adds the capability to merge panics triggered from within a http handler (and a test case).

The example HTTP handler I used to trigger the message is below:

package main

import (
	"net/http"
)

func doPanic(w http.ResponseWriter, r *http.Request) {
	panic("test panic")
}

func main() {
	http.HandleFunc("/", doPanic)
	http.ListenAndServe(":8080", nil)
}

Copy link
Contributor

@qingling128 qingling128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sent some minor suggestion. BTW, this one seems to require rebasing.

Copy link
Contributor

@qingling128 qingling128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qingling128 qingling128 merged commit 38c60c5 into GoogleCloudPlatform:master Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Golang HTTP handler stack traces not collapsed

2 participants