Grafana

From NixOS Wiki
Revision as of 13:07, 30 May 2022 by imported>Exyi (Created page with "[https://grafana.com/ Grafana] is an open-source, general purpose dashboarding tool, which runs as a web application. It can be used to create a variety of time-series graphs...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Grafana is an open-source, general purpose dashboarding tool, which runs as a web application. It can be used to create a variety of time-series graphs and also for displaying logs. It supports Prometheus, graphite, InfluxDB, opentsdb, Grafana Loki, PostgreSQL and many other data sources.

See Grafana options

Installation

Grafana is available as NixOS module, it can be enabled using the following config:

services.grafana = {
      enable = true;
      # Listening address and TCP port
      addr = "127.0.0.1";
      port = 3000;
      # Grafana needs to know on which domain and URL it's running:
      domain = "your.domain";
      rootUrl = "https://your.domain/grafana/"; # Not needed if it is `https://your.domain/`
};

This will make Grafana available only at localhost. On a server, it might be used through SSH tunnel or made publicly available using nginx with TLS. For example the follwing Nginx configuration can be used:

  services.nginx.virtualHosts."your.domain" = {
    addSSL = true;
    enableACME = true;
    locations."/grafana/" = {
        proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
        proxyWebsockets = true;
    };
  };

Usage

Log into the Grafana web application (using default user: admin, password: admin). Everything else (data sources, users, dashboards, ...) is configured in the Web UI. Refer to the official documentation on how to do it:

External Links