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

Log debug ouput when probe failed #371

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@anhdat

anhdat commented Oct 11, 2018

As in #350, when the probe failed we want to see the content of the response and we can only do it may be hours after the incident. By that time, the history is lost and we have no record to understand what happened. With writing to log stream, the exporter allows users read application log file for investigation purpose.

anhdat added some commits Oct 11, 2018

Log debug ouput when probe failed
Signed-off-by: Dat Truong <mr.anhdat@gmail.com>
Add HTTP response headers and body to debug output
Signed-off-by: Dat Truong <mr.anhdat@gmail.com>
@@ -134,6 +134,11 @@ func probeHandler(w http.ResponseWriter, r *http.Request, c *config.Config, logg
debugOutput := DebugOutput(&module, &sl.buffer, registry)
rh.Add(moduleName, target, debugOutput, success)
// log out debug ouput if probe failed
if !success {
level.Error(logger).Log("msg", debugOutput)

This comment has been minimized.

@SuperQ

SuperQ Oct 11, 2018

Member

I think this should be Debug level, rather than error.

@SuperQ

SuperQ Oct 11, 2018

Member

I think this should be Debug level, rather than error.

This comment has been minimized.

@brian-brazil

brian-brazil Oct 11, 2018

Member

We already log this, see about 10 lines up.

@brian-brazil

brian-brazil Oct 11, 2018

Member

We already log this, see about 10 lines up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment