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

metrics: make it possible to spin up Grafana using docker-compose #2383

Merged
merged 4 commits into from Jun 21, 2023

Conversation

marten-seemann
Copy link
Contributor

As a last step to finish our metrics story, here's an easy way to make them more useful for local development.Just run

docker-compose up

and your local Grafana instance is up and running, collecting metrics from your libp2p node! See README for more instructions.

dashboards/README.md Outdated Show resolved Hide resolved
Co-authored-by: Prithvi Shahi <shahi.prithvi@gmail.com>
@marten-seemann
Copy link
Contributor Author

@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).

Copy link
Member

@sukunrt sukunrt left a 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.

dashboards/docker-compose.yml Outdated Show resolved Hide resolved
@marten-seemann marten-seemann mentioned this pull request Jun 21, 2023
29 tasks
@marten-seemann marten-seemann merged commit 139af10 into master Jun 21, 2023
19 checks passed
@@ -691,6 +691,16 @@
"tags": [],
"templating": {
"list": [
{
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #2387.

@MarcoPolo
Copy link
Contributor

Should we remove the old example then?

@marten-seemann
Copy link
Contributor Author

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
Copy link
Contributor

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

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.

None yet

4 participants