-
Notifications
You must be signed in to change notification settings - Fork 5.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
Added pprof tool #2512
Added pprof tool #2512
Conversation
thanks for adding this, can you add it to the I would also call the flag |
@sparrc I've just added Reason why we've added pprof - high CPU consumption by Telegraf: up to 20% of total CPU on modern servers. |
@sparrc please, run CI tests again: https://circleci.com/gh/influxdata/telegraf/6260 - its timed out |
@sparrc Let's include this into 1.3.0? |
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.
Lets update the log message and add this to the CHANGELOG and we should be good to go.
cmd/telegraf/telegraf.go
Outdated
if *pprofAddr != "" { | ||
go func() { | ||
log.Printf( | ||
"I! Starting pprof on %s. Open profiling tools page in browser: /debug/pprof", |
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.
I think we have all the information we need to print the full url to this page, let have it write something like:
I! Starting pprof HTTP server at http://localhost:6060/debug/pprof
This way I can click on it or copy paste it more easily.
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.
@danielnelson, thanks for review. Changes done.
Could you also move forward our contributions:
#2387
#2594
We hope to see them in 1.3 too
Can you rebase? |
Nevermind, It's merged! |
Added standard GO pprof tool to Telegraf. This tool is useful for developers: from time to time we need to understand, which plugin or subsystem of Telegraf consumes too much resources.
By default, pprof is disabled.
To enable pprof run Telegraf with
pprofaddr
parameter:telegraf --config etc/telegraf.conf --pprofaddr localhost:6060