Install Grafana Renderer

RoomIT
1 min readNov 29, 2022

--

Grafana Renderer is plugin for render content and can send to media notification

Install NodeJS

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - &&\
sudo apt-get install -y nodejs

Install Yarn

   curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn

Install Grafana Renderer

wget https://github.com/grafana/grafana-image-renderer/archive/refs/heads/master.zip
unzip master.zip -d /opt/
mkdir -p /opt/grafana-plugin
mv /opt/grafana-image-renderer-master /opt/grafana-plugin/

Depedencies Ubuntu

apt install libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxi6 libxtst6 libnss3 libcups2 libxss1 libxrandr2 libasound2 libatk1.0-0 libatk-bridge2.0-0 libpangocairo-1.0-0 libgtk-3-0

Build

yarn install --pure-lockfile
yarn run build

Create Systemd

cat > /etc/systemd/system/grafana-render.service<<EOF
[Unit]
Description=Grafana instance
Documentation=http://docs.grafana.org
Wants=network-online.target
After=network-online.target
After=postgresql.service mariadb.service mysql.service

[Service]
User=grafana
Group=grafana
Type=simple
ExecStart=/usr/bin/node /opt/grafana-plugin/grafana-image-renderer-master/build/app.js server --port=8081

[Install]
WantedBy=multi-user.target
EOF

Reload Init systemd

systemctl daemon-reload

Start Service

systemctl start grafana-render

Install Plugin

grafana-cli plugins install grafana-image-renderer

Add in /etc/grafana/grafana.ini

[rendering]
server_url = http://localhost:8081/render
callback_url = http://localhost:3000/

Restart Grafana

systemctl restart grafana-server

--

--

RoomIT
RoomIT

Written by RoomIT

We write around -> Blockchain | DevOps | Security | Sysadmin

No responses yet