Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Add parsing rules, and a test case, for "Go panicing in a http handler" - #49

Merged
qingling128 merged 5 commits into
GoogleCloudPlatform:masterfrom
vatine:master
Aug 14, 2019
Merged

qingling128 merged 5 commits into
GoogleCloudPlatform:masterfrom
vatine:master

Conversation

@vatine

@vatine vatine commented Jan 15, 2019 •

Copy link
Copy Markdown
Contributor

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)
}

@qingling128 qingling128 left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread lib/fluent/plugin/exception_detector.rb Outdated
Comment thread lib/fluent/plugin/exception_detector.rb Outdated

@qingling128 qingling128 left a comment

Copy link
Copy Markdown
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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