monitoring/

directory
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2023 License: GPL-3.0

README



SSV - Monitoring

/metrics end-point is exposing metrics from ssv node to prometheus.

Prometheus should also hit /health end-point in order to collect the health check metrics.
Even if prometheus is not configured, the end-point can simply be polled by a simple HTTP client (it doesn't contain metrics)

See the configuration of a local prometheus service.

Health Check

Health check route is available on GET /health.
In case the node is healthy it returns an HTTP Code 200 with empty response:

$ curl http://localhost:15000/health

If the node is not healthy, the corresponding errors will be returned with HTTP Code 500:

$ curl http://localhost:15000/health
{"errors": ["could not sync eth1 events"]}

Metrics

MetricsAPIPort is used to enable prometheus metrics collection:

Example:

MetricsAPIPort: 15000

Or as env variable:

METRICS_API_PORT=15000

Grafana

In order to setup a grafana dashboard do the following:

  1. Enable metrics (MetricsAPIPort)
  2. Setup Prometheus as mentioned in the beginning of this document and add as data source
    • Job name assumed to be 'ssv'
  3. Import dashboards to Grafana:
  4. Align dashboard variables:
    • instance - container name, used in 'instance' field for metrics coming from prometheus.
      In the given dashboard, instances names are: ssv-node-v2-<i>, make sure to change according to your setup

Profiling

Profiling can be enabled via config:

EnableProfile: true

All the default pprof routes are available via HTTP:

$ curl http://localhost:15000/debug/pprof/goroutine?minutes\=20 --output goroutines.tar.gz

Open with Go CLI:

$ go tool pprof goroutines.tar.gz

Or with Web UI:

$ go tool pprof -web goroutines.tar.gz

Another option is to visualize results in web UI directly:

$ go tool pprof -web http://localhost:15001/debug/pprof/heap?minutes=5

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL