-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
metrics: make it possible to spin up Grafana using docker-compose #2383
Conversation
Co-authored-by: Prithvi Shahi <shahi.prithvi@gmail.com>
@sukunrt Have you tried running this on your machine? Would be good to get a check that this actually works. Ideally, running a libp2p node with the code snippet in the README (not a Kubo node). |
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 just ran it. It works fine. Picked up metrics for my locally running Kubo instance. We should also add the hole punch metrics dashboard.
There's one thing though, this also happened when using the metrics and dashboard example. If you are logged in to a grafana running locally(i was running one via homebrew), you'll get an "Unauthorized" error and you'll need to clear your browser cache to make it work. In hindsight, it's obvious what's happening but the first time this happened to me, I spent about half an hour figuring out what's wrong.
@@ -691,6 +691,16 @@ | |||
"tags": [], | |||
"templating": { | |||
"list": [ | |||
{ |
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.
Didn’t know you could do this. Cool!
scheme: http | ||
static_configs: | ||
- targets: | ||
- host.docker.internal:5001 |
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.
This only works on macos. This will fail on linux
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.
How would this work on Linux?
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.
there's no easy way unfortunately. You can use https://github.com/qoomon/docker-host but that requires binding the host thing to 0.0.0.0 (or at least the bridge interface).
You can do network_mode=host
, but then that doesn't work for MacOS environmnets.
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 opened #2387.
Should we remove the old example then? |
Makes sense. Can you open a PR? |
orgId: 1 | ||
type: prometheus | ||
access: proxy | ||
url: http://host.docker.internal:9090 |
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.
This should be prometheus:9090
As a last step to finish our metrics story, here's an easy way to make them more useful for local development.Just run
and your local Grafana instance is up and running, collecting metrics from your libp2p node! See README for more instructions.