You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Marten Seemann d616720a16
metrics: provide separate docker-compose files for OSX and Linux (#2397)
1 year ago
..
autonat metrics: make it possible to spin up Grafana using docker-compose (#2383) 1 year ago
autorelay metrics: make it possible to spin up Grafana using docker-compose (#2383) 1 year ago
eventbus metrics: make it possible to spin up Grafana using docker-compose (#2383) 1 year ago
holepunch metrics: make it possible to spin up Grafana using docker-compose (#2383) 1 year ago
identify metrics: make it possible to spin up Grafana using docker-compose (#2383) 1 year ago
relaysvc metrics: make it possible to spin up Grafana using docker-compose (#2383) 1 year ago
resource-manager rcmgr: move StatsTraceReporter to rcmgr package (#2388) 1 year ago
swarm swarm: implement blackhole detection (#2320) 1 year ago
README.md metrics: provide separate docker-compose files for OSX and Linux (#2397) 1 year ago
dashboard.yml metrics: make it possible to spin up Grafana using docker-compose (#2383) 1 year ago
datasources.yml metrics: make it possible to spin up Grafana using docker-compose (#2383) 1 year ago
docker-compose-linux.yml metrics: provide separate docker-compose files for OSX and Linux (#2397) 1 year ago
docker-compose-osx.yml metrics: provide separate docker-compose files for OSX and Linux (#2397) 1 year ago
prometheus.yml metrics: make it possible to spin up Grafana using docker-compose (#2383) 1 year ago

README.md

Grafana Dashboards

This directory contains prebuilt dashboards (provided as JSON files) for various components. For steps on how to import and use them please read the official Grafana documentation.

Using locally

For local development and debugging, it can be useful to spin up a local Prometheus and Grafana instance.

To expose metrics, we first need to expose a metrics collection endpoint. Add this to your code:

import "github.com/prometheus/client_golang/prometheus/promhttp"

go func() {
    http.Handle("/debug/metrics/prometheus", promhttp.Handler())
    log.Fatal(http.ListenAndServe(":5001", nil))
}()

This exposes a metrics collection endpoint at http://localhost:5001/debug/metrics/prometheus. Note that this is the same endpoint that Kubo uses, so if you want to gather metrics from Kubo, you can skip this step.

On Linux, dashboards can be inspected locally by running:

docker-compose -f docker-compose-linux.yml up

On macOS:

docker-compose -f docker-compose-osx.yml up

and opening Grafana at http://localhost:3000.

Making Dashboards usable with Provisioning

The following section is only relevant for creators of dashboards.

Due to a bug in Grafana, it's not possible to provision dashboards shared for external use directly. We need to apply the workaround described in https://github.com/grafana/grafana/issues/10786#issuecomment-568788499 (adding a few lines in the dashboard JSON file).