Skip to content
Raman Sailopal edited this page Jun 10, 2021 · 13 revisions

Setup Guide - Grafana/Prometheus

  1. Install Grafana - https://grafana.com/docs/grafana/latest/installation/
  2. Install Prometheus - https://prometheus.io/docs/prometheus/latest/installation/
  3. Run the YottaDB metrics “exporter” by following the instructions here https://github.com/RamSailopal/yotta-dashboard/blob/main/README.md
  4. Add the extract found at https://raw.githubusercontent.com/RamSailopal/yotta-dashboard/main/prometheus.yml to the prometheus.yml config file in /etc/prometheus. Change the IP address and port to the address/port of the server where the “exporter” is running accordingly.
  5. Start Prometheus
  6. Start Grafana and log into the web interface (default port is 3000, default username and password is admin/admin)
  7. Click on the cog icon on the left hand side representing configuration, then Data Sources and Add Data Source. Select the Prometheus data source. Name it and then enter the URL. Click Save and Test to ensure it is working.
  8. Click on the four square boxes icon on the left hand side representing Dashboards. Click Manage and then Import. Paste the JSON found here - https://raw.githubusercontent.com/RamSailopal/yotta-dashboard/main/examples/Yottadb-grafana.json to the json panel. Click Load.
  9. A dashboard will then be created showing Orders, Sets and Gets metrics. To add further metrics, click on the add panel icon, then click the Metrics “drop down” option in the Query section, ensuring that Prometheus is selected as the data source. All the metrics exported from YottaDB should now appear for selection to chart in a panel.

Additional Setup = Loki/Promtail

  1. Attain the latest copy of Loki - e.g. curl -O -L "https://github.com/grafana/loki/releases/download/v2.2.1/loki-linux-amd64.zip"
  2. Unzip the file to attain the executable - unzip "loki-linux-amd64.zip"
  3. Give the executable file executable permissions - chmod a+x "loki-linux-amd64"
  4. Move the executable file to an executable system path and rename to loki - mv "loki-linux-amd64" "/usr/local/bin/loki"
  5. Create a configuration directory for Loki - mkdir "/etc/Loki"
  6. Copy the configuration yaml file cp "loki.yaml" "/etc/loki"
  7. Amend the configuration file with the correct IP address accordingly
  8. Create a systemd service file - cp "systemd/loki.service" "/usr/lib/systemd/system/loki.service"
  9. Attain the latest copy of Promtail - e.g. curl -O -L "https://github.com/grafana/loki/releases/download/v2.2.1/promtail-linux-arm64.zip"
  10. Unzip the file to attain the executable - unzip "promtail-linux-amd64.zip"
  11. Give the executable file executable permissions - chmod a+x "promtail-linux-amd64"
  12. Move the executable file to an executable system path and rename to loki - mv "promtail-linux-amd64" "/usr/local/bin/promtail"
  13. Create a configuration directory for Loki - mkdir "/etc/promtail"
  14. Copy the configuration yaml file cp "promtail.yaml" "/etc/promtail"
  15. Create a systemd service file - cp "systemd/promtail.service" "/usr/lib/systemd/system/promtail.service"
  16. Reload the systemd daemon - systemctl daemon-reload
  17. Start the Loki service - systemctl start loki
  18. Start the Promtail service - systemctl start promtail 19.Add the JSON from https://raw.githubusercontent.com/RamSailopal/yotta-dashboard/main/examples/Yottadb-graf-loki.json to create a new dashboard (as instructed earlier)
Clone this wiki locally