Skip to content

Grafana installation

smilebasti edited this page Jun 9, 2023 · 10 revisions

Grafana is not required but it displays the data that got gathered and stored in InfluxDB.

A complete installation example is available with the docker-compose.yml file.

Installing Grafana

Docker Compose

version: '3.8'
services:
  grafana:
    image: grafana/grafana-oss
    restart: unless-stopped
    ports:
      - '3000:3000'
    volumes:
      - ./grafana-storage:/var/lib/grafana # after start: sudo chown 472:472 grafana-storage 

Set up Grafana for npmGrafStats

Create a new Data source

  1. In settings create a new data source to connect to InfluxDB. Set the follwing:
  • a name (you can choose)
  • select Flux as query language
  • set url to your influxdb ip and port (don't forget http(s):// )
  • disable basic auth
  • set organization and bucket to npmgrafstats (the bucket name is hard-coded into the Dashboard see #14)
  • set token to a read API token created in InfluxDB
  1. Import or upload a Dashboard. You can from Grafana using the ID 18826. You can also upload it manually using the NPM Map Dashboard.json file. Select the beforehand created data source to be used.

For original installation instructions see: https://grafana.com/docs/grafana/latest/setup-grafana/installation/docker/

Clone this wiki locally