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

Basic write-path logging #1858

Merged
merged 3 commits into from
Mar 6, 2015
Merged

Basic write-path logging #1858

merged 3 commits into from
Mar 6, 2015

Conversation

otoolep
Copy link
Contributor

@otoolep otoolep commented Mar 6, 2015

No description provided.

@otoolep
Copy link
Contributor Author

otoolep commented Mar 6, 2015

Pretty basic, not fancy. @pauldix

@@ -174,6 +174,7 @@ enabled = true

[logging]
file = "influxdb.log"
write-tracing-enabled = true
Copy link
Member

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.

@pauldix
Copy link
Member

pauldix commented Mar 6, 2015

Add write tracing to the handler. If it's enabled we should output the string JSON data that is posted to /write. Also worth adding to the other input plugins too.

Also, add the option and a comment about what it does if its set to true to the config.sample.toml file.

@otoolep
Copy link
Contributor Author

otoolep commented Mar 6, 2015

Oh yeah, forgot about the sample file.

@otoolep
Copy link
Contributor Author

otoolep commented Mar 6, 2015

Updated with changes to config file flag, and tracing also added to handler, which dumps JSON data.

@otoolep otoolep force-pushed the server_stats branch 2 times, most recently from b2c5ecc to 9ed4411 Compare March 6, 2015 01:12
@@ -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))
Copy link
Member

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

Copy link
Contributor Author

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.

@otoolep
Copy link
Contributor Author

otoolep commented Mar 6, 2015

Verbal +1 form @pauldix

@otoolep
Copy link
Contributor Author

otoolep commented Mar 6, 2015

Green build, merging now.

otoolep added a commit that referenced this pull request Mar 6, 2015
@otoolep otoolep merged commit e997fda into master Mar 6, 2015
@otoolep otoolep deleted the server_stats branch March 6, 2015 01:40
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.

2 participants