-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Basic write-path logging #1858
Basic write-path logging #1858
Conversation
Pretty basic, not fancy. @pauldix |
@@ -174,6 +174,7 @@ enabled = true | |||
|
|||
[logging] | |||
file = "influxdb.log" | |||
write-tracing-enabled = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove enabled. It's in the logging section and it's boolean. write-tracing = true
is shorter and cleaner. And we're going to have a ton of options here so we'd end up having enabled
on the end of every one of those.
Add write tracing to the handler. If it's enabled we should output the string JSON data that is posted to Also, add the option and a comment about what it does if its set to |
Oh yeah, forgot about the sample file. |
Updated with changes to config file flag, and tracing also added to handler, which dumps JSON data. |
b2c5ecc
to
9ed4411
Compare
@@ -187,6 +194,11 @@ func (h *Handler) serveWrite(w http.ResponseWriter, r *http.Request, user *influ | |||
return | |||
} | |||
|
|||
if h.WriteTrace { | |||
b, _ := json.Marshal(bp) | |||
h.Logger.Printf("write received by handler: %s", string(b)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should do this before the marshal. Do it on the raw bytes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pauldix and I just spoke about this, it's not quite trivial since r.Body
is not a simple object. Still, I'll revisit this and see what we can do.
Verbal +1 form @pauldix |
Green build, merging now. |
No description provided.