Git Product home page Git Product logo

Comments (6)

srebhan avatar srebhan commented on June 1, 2024 1

Hmmm work for me on current master... I used the following config for testing

[agent]
interval = "1m"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 75000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
hostname = ""
omit_hostname = false

[[inputs.cpu]]

[[outputs.file]]
  files = ["stdout"]

and ran telegraf --config test.conf --debug --pprof-addr localhost:6060 and get a page on

http://localhost:6060/debug/pprof/

from telegraf.

powersj avatar powersj commented on June 1, 2024 1

ok - I do think we should re-add this even though it is working and not rely on the fact that we are somehow getting lucky with an import.

@rebrendov I've re-opened your PR, could you look at whatever CI issues remain?

from telegraf.

rebrendov avatar rebrendov commented on June 1, 2024

Hmm, works for me as well on master (though I do not understand why, since there is no net/http/pprof import anywhere - would very much appreciate if you'd give me a clue).
Seems like my problem was that I was running custom build and was mislead by the logs, tried that on master as well (test.conf is the same config you provided above)

# make build_tools
# ./tools/custom_builder/custom_builder --config test.conf
# ./telegraf --config test.conf --debug --pprof-addr localhost:6060
2024-03-28T09:18:12Z I! Loading config: test.conf
2024-03-28T09:18:12Z I! Starting pprof HTTP server at: http://localhost:6060/debug/pprof
2024-03-28T09:18:12Z I! Starting Telegraf 1.31.0-164f6790 (customized) brought to you by InfluxData the makers of InfluxDB

Still says that pprof HTTP server is starting, but http://localhost:6060/debug/pprof/ returns 404.

I guess I should close my PR since it works on master. Though not sure how to fix this for custom builds. I mean the change in the PR works for enabling pprof for custom builds and thats what i did to my telegraf, but it looks redundant for master build since it works without importing net/http/pprof explicitly.

from telegraf.

powersj avatar powersj commented on June 1, 2024

Thanks for the update @rebrendov

My understanding is that if telegraf, or any of its dependencies import net/http/pprof then the handlers are available. You may be on to something that we probably should ensure it is imported.

In your custom build, what are you doing differently? Is it just removing plugins? Or are you modifying anything outside of plugins?

from telegraf.

rebrendov avatar rebrendov commented on June 1, 2024

Yes I just remove plugins to speed up compilation.

from telegraf.

rebrendov avatar rebrendov commented on June 1, 2024

I see you already fixed the linter issue in PR, thank you.
Also fwiw I did find the dependency that was importing net/http/pprof as you have guessed. It was "github.com/nats-io/nats-server/v2/server" that is used by nats input plugin.

from telegraf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.