• Stars
    star
    314
  • Rank 128,254 (Top 3 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kiosk Utility for Grafana

Grafana Kiosk

Build Status Go Report Card Maintainability Test Coverage

A very useful feature of Grafana is the ability to display dashboards and playlists on a large TV.

This provides a utility to quickly standup a kiosk on devices like a Raspberry Pi or NUC.

The utitilty provides these options:

  • Login
    • to a Grafana server (local account)
    • to a Grafana server with anonymous-mode enabled (same method used on play.grafana.org)
    • to a Grafana Cloud instance
    • to a Grafana server with OAuth enabled
    • to an AWS Managed Grafana instance (both with and without MFA)
  • Switch to kiosk or kiosk-tv mode
  • Display the default home page set for the user
  • Display a specified dashboard
  • Start a playlist immediately (inactive mode enable)
  • Can specify where to start kiosk for multiple displays

Additionally, an initialize option is provided to configure LXDE for Raspberry Pi Desktop.

Installing on Linux

Download the zip or tar file from releases

The release file includes pre-built binaries. See table below for the types available.

OS Architecture Description Executable
linux amd64 64bit grafana-kiosk.linux.amd64
linux 386 32bit grafana-kiosk.linux.386
linux arm64 64bit Arm v7 grafana-kiosk.linux.arm64
linux arm ARM v5 grafana-kiosk.linux.armv5
linux arm ARM v6 grafana-kiosk.linux.armv6
linux arm ARM v7 grafana-kiosk.linux.armv7
darwin amd64 64bit grafana-kiosk.darwin.amd64
windows amd64 64bit grafana-kiosk.windows.amd64.exe

Extract the zip or tar file, and copy the appropriate binary to /usr/bin/grafana-kiosk:

# sudo cp -p grafana-kiosk.linux.armv7 /usr/bin/grafana-kiosk
# sudo chmod 755 /usr/bin/grafana-kiosk

Dependencies/Suggestion Packages

This application can run on most operating systems, but for linux some additional binaries are suggested for full support.

Suggesting Packages:

unclutter (for hiding mouse/cursor) rng-tools (for entropy issues)

Usage

NOTE: Flags with parameters should use an "equals" -autofit=true -URL=https://play.grafana.org when used with any boolean flags.

  -URL string
      URL to Grafana server (default "https://play.grafana.org")
  -apikey string
      apikey
  -audience string
      idtoken audience
  -auto-login
      oauth_auto_login is enabled in grafana config
  -autofit
      Fit panels to screen (default true)
  -c string
      Path to configuration file (config.yaml)
  -field-password string
      Fieldname for the password (default "password")
  -field-username string
      Fieldname for the username (default "username")
  -ignore-certificate-errors
      Ignore SSL/TLS certificate error
  -keyfile string
      idtoken json credentials (default "key.json")
  -kiosk-mode string
      Kiosk Display Mode [full|tv|disabled]
        full = No TOPNAV and No SIDEBAR
        tv = No SIDEBAR
        disabled = omit option
        (default "full")
  -login-method string
      [anon|local|gcom|goauth|idtoken|apikey|aws] (default "anon")
  -lxde
      Initialize LXDE for kiosk mode
  -lxde-home string
      Path to home directory of LXDE user running X Server (default "/home/pi")
  -password string
      password (default "guest")
  -playlists
      URL is a playlist
  -username string
      username (default "guest")
  -use-mfa
      MFA is enabled for given account (default false)
  -window-position string
      Top Left Position of Kiosk (default "0,0")
  -window-size string
      Size of Kiosk in pixels (e.g. "1920,1080")

Using a configuration file

The kiosk can also be started using a configuration file, along with environment variables. When using this option, all other arguments passed are ignored.

general:
  kiosk-mode: full
  autofit: true
  lxde: true
  lxde-home: /home/pi

target:
  login-method: anon
  username: user
  password: changeme
  playlist: false
  URL: https://play.grafana.org
  ignore-certificate-errors: false
grafana-kiosk -c config.yaml

Environment variables can be set and will override the configuration file. They can also be used instead of a configuration file.

  KIOSK_AUTOFIT bool
      fit panels to screen (default "true")
  KIOSK_LXDE_ENABLED bool
      initialize LXDE for kiosk mode (default "false")
  KIOSK_LXDE_HOME string
      path to home directory of LXDE user running X Server (default "/home/pi")
  KIOSK_MODE string
      [full|tv|disabled] (default "full")
  KIOSK_WINDOW_POSITION string
      Top Left Position of Kiosk (default "0,0")
  KIOSK_WINDOW_SIZE string
      Size of Kiosk in pixels (e.g. "1920,1080")
  KIOSK_IGNORE_CERTIFICATE_ERRORS bool
      Ignore SSL/TLS certificate errors (default "false")
  KIOSK_IS_PLAYLIST bool
      URL is a playlist (default "false")
  KIOSK_LOGIN_METHOD string
      [anon|local|gcom|goauth|idtoken|apikey|aws] (default "anon")
  KIOSK_LOGIN_PASSWORD string
      password (default "guest")
  KIOSK_URL string
      URL to Grafana server (default "https://play.grafana.org")
  KIOSK_LOGIN_USER string
      username (default "guest")
  KIOSK_GOAUTH_AUTO_LOGIN bool
      [false|true]
  KIOSK_GOAUTH_FIELD_USER string
      Username html input name value
  KIOSK_GOAUTH_FIELD_PASSWORD string
      Password html input name value
  KIOSK_IDTOKEN_KEYFILE string
      JSON Credentials for idtoken (default "key.json")
  KIOSK_IDTOKEN_AUDIENCE string
      Audience for idtoken, tpyically your oauth client id
  KIOSK_APIKEY_APIKEY string
      APIKEY Generated in Grafana Server

Hosted Grafana using grafana.com authentication

This will login to a Hosted Grafana instance and take the browser to the default dashboard in fullscreen kiosk mode:

./bin/grafana-kiosk -URL=https://bkgann3.grafana.net -login-method=gcom -username=bkgann -password=abc123 -kiosk-mode=full

This will login to a Hosted Grafana instance and take the browser to a specific dashboard in tv kiosk mode:

./bin/grafana-kiosk -URL=https://bkgann3.grafana.net/dashboard/db/sensu-summary -login-method=gcom -username=bkgann -password=abc123 -kiosk-mode tv

This will login to a Hosted Grafana instance and take the browser to a playlist in fullscreen kiosk mode, and autofit the panels to fill the display.

./bin/grafana-kiosk -URL=https://bkgann3.grafana.net/playlists/play/1 -login-method=gcom -username=bkgann -password=abc123 -kiosk-mode=full -playlists -autofit=true

Grafana Server with Local Accounts

This will login to a grafana server that uses local accounts:

./bin/grafana-kiosk -URL=https://localhost:3000 -login-method=local -username=admin -password=admin -kiosk-mode=tv

If you are using a self-signed certificate, you can remove the certificate error with -ignore-certificate-errors

./bin/grafana-kiosk -URL=https://localhost:3000 -login-method=local -username=admin -password=admin -kiosk-mode=tv -ignore-certificate-errors

Grafana Server with Anonymous access enabled

This will take the browser to the default dashboard on play.grafana.org in fullscreen kiosk mode (no login needed):

./bin/grafana-kiosk -URL=https://play.grafana.org -login-method=anon -kiosk-mode=tv

This will take the browser to a playlist on play.grafana.org in fullscreen kiosk mode (no login needed):

./bin/grafana-kiosk -URL=https://play.grafana.org/playlists/play/1 -login-method=anon -kiosk-mode=tv

Grafana Server with Api Key

This will take the browser to the default dashboard on play.grafana.org in fullscreen kiosk mode:

./bin/grafana-kiosk -URL=https://play.grafana.org -login-method apikey --apikey "xxxxxxxxxxxxxxx" -kiosk-mode=tv

Grafana Server with Generic Oauth

This will login to a Generic Oauth service, configured on Grafana. Oauth_auto_login is disabeld. As Oauth provider is Keycloak used.

go run pkg/cmd/grafana-kiosk/main.go -URL=https://my.grafana.oauth/playlists/play/1  -login-method=goauth -username=test -password=test

This will login to a Generic Oauth service, configured on Grafana. Oauth_auto_login is disabeld. As Oauth provider is Keycloak used and also the login and password html input name is set.

go run pkg/cmd/grafana-kiosk/main.go -URL=https://my.grafana.oauth/playlists/play/1 -login-method=goauth -username=test -password=test -field-username=username -field-password=password

This will login to a Generic Oauth service, configured on Grafana. Oauth_auto_login is enabled. As Oauth provider is Keycloak used and also the login and password html input name is set.

go run pkg/cmd/grafana-kiosk/main.go -URL=https://my.grafana.oauth/playlists/play/1 -login-method=goauth -username=test -password=test -field-username=username -field-password=password -auto-login=true

Google Idtoken authentication

This allows you to log in through Google Identity Aware Proxy using a service account through injecting authorization headers with bearer tokens into each request. the idtoken library will generate new tokens as needed on expiry, allowing grafana kiosk mode without exposing a fully privileged google user on your kiosk device.

./bin/grafana-kiosk -URL=https://play.grafana.org/playlists/play/1 -login-method=idtoken -keyfile /tmp/foo.json -audience myoauthid.apps.googleusercontent.com

LXDE Options

The -lxde option initializes settings for the desktop.

Actions Performed:

  • sets profile via lxpanel to LXDE
  • sets pcmanfs profile to LXDE
  • runs xset s off to disable screensaver
  • runs xset -dpms to disable power-saving (prevents screen from turning off)
  • runs xset s noblank disables blank mode for screensaver (maybe not needed)
  • runs unclutter to hide the mouse

The -lxde-home option allows you to specify a different $HOME directory where the lxde configuration files can be found.

Automatic Startup

Session-based

LXDE can start the kiosk automatically by creating this file:

Create/edit the file: /home/pi/.config/lxsession/LXDE-pi/autostart

/usr/bin/grafana-kiosk -URL=https://bkgann3.grafana.net/dashboard/db/sensu-summary -login-method=gcom -username=bkgann -password=abc123 -kiosk-mode=full -lxde

Session with disconnected "screen"

Alternatively you can run grafana-kiosk under screen, which can very useful for debugging.

Create/edit the file: /home/pi/.config/lxsession/LXDE-pi/autostart

screen -d -m bash -c "/usr/bin/grafana-kiosk -URL=https://bkgann3.grafana.net/dashboard/db/sensu-summary -login-method=gcom -username=bkgann -password=abc123 -kiosk-mode=full -lxde"

Desktop Link

Create/edit the file: /home/pi/.config/autostart/grafana-kiosk.desktop

[Desktop Entry]
Type=Application
Exec=/usr/bin/grafana-kiosk -URL=https://bkgann3.grafana.net/dashboard/db/sensu-summary -login-method=gcom -username=bkgann -password=abc123 -kiosk-mode=full -lxde

Desktop Link with disconnected "screen"

[Desktop Entry]
Type=Application
Exec=screen -d -m bash -c /usr/bin/grafana-kiosk -URL=https://bkgann3.grafana.net/dashboard/db/sensu-summary -login-method=gcom -username=bkgann -password=abc123 -kiosk-mode=full -lxde

Systemd startup

# sudo touch /etc/systemd/system/grafana-kiosk.service
# sudo chmod 664 /etc/systemd/system/grafana-kiosk.service
[Unit]
Description=Grafana Kiosk
Documentation=https://github.com/grafana/grafana-kiosk
Documentation=https://grafana.com/blog/2019/05/02/grafana-tutorial-how-to-create-kiosks-to-display-dashboards-on-a-tv
After=network.target

[Service]
User=pi
Environment="DISPLAY=:0"
Environment="XAUTHORITY=/home/pi/.Xauthority"

# Disable screensaver and monitor standby
ExecStartPre=xset s off
ExecStartPre=xset -dpms
ExecStartPre=xset s noblank

ExecStart=/usr/bin/grafana-kiosk -URL=<url> -login-method=local -username=<username> -password=<password> -playlists=true

[Install]
WantedBy=graphical.target

Reload systemd:

# sudo systemctl daemon-reload

Enable, Start, Get Status, and logs:

# sudo systemctl enable grafana-kiosk
# sudo systemctl start grafana-kiosk
# sudo systemctl status grafana-kiosk

Logs:

journalctl -u grafana-kiosk

Troubleshooting

Timeout Launching

2020/08/24 10:18:41 Launching local login kiosk
panic: websocket url timeout reached

Often this is due to lack of entropy, for linux you would need to install rng-tools (or an equivalent).

apt install rng-tools

Building

A Magefile is provided for building the utility, you can install mage by following the instructions at https://magefile.org/

mage -v

This will generate executables in "bin" that can be run on a variety of platforms.

For full build and testing options use:

mage -l

TODO

  • RHEL/CentOS auto-startup
  • Everything in issues!

References

Thanks to our Contributors

Any many others!

More Repositories

1

grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
TypeScript
60,280
star
2

k6

A modern load testing tool, using Go and JavaScript - https://k6.io
Go
22,905
star
3

loki

Like Prometheus, but for logs.
Go
22,069
star
4

pyroscope

Continuous Profiling Platform. Debug performance issues down to a single line of code
C
9,361
star
5

mimir

Grafana Mimir provides horizontally scalable, highly available, multi-tenant, long-term storage for Prometheus.
Go
3,634
star
6

tempo

Grafana Tempo is a high volume, minimal dependency distributed tracing backend.
Go
3,561
star
7

oncall

Developer-friendly incident response with brilliant Slack integration
Python
3,223
star
8

tanka

Flexible, reusable and concise configuration for Kubernetes
Go
2,235
star
9

phlare

🔥 horizontally-scalable, highly-available, multi-tenant continuous profiling aggregation system
Go
2,059
star
10

grafana-zabbix

Zabbix plugin for Grafana dashboard
TypeScript
2,020
star
11

agent

Vendor-neutral programmable observability pipelines.
Go
1,544
star
12

helm-charts

Smarty
1,494
star
13

grafonnet-lib

Jsonnet library for generating Grafana dashboard files.
Jsonnet
1,079
star
14

beyla

eBPF-based autoinstrumentation of HTTP and HTTPS services
C
1,032
star
15

grafana-operator

An operator for Grafana that installs and manages Grafana instances, Dashboards and Datasources through Kubernetes/OpenShift CRs
Go
756
star
16

alloy

OpenTelemetry Collector distribution with programmable pipelines
Go
711
star
17

grafana-docker

Grafana docker container
Shell
638
star
18

metrictank

metrics2.0 based, multi-tenant timeseries store for Graphite and friends.
Go
623
star
19

faro-web-sdk

The Grafana Faro Web SDK, part of the Grafana Faro project, is a highly configurable web SDK for real user monitoring (RUM) that instruments browser frontend applications to capture observability signals. Frontend telemetry can then be correlated with backend and infrastructure data for full-stack observability.
TypeScript
623
star
20

grafana-infinity-datasource

CSV, JSON, GraphQL, XML and HTML datasource for grafana.
TypeScript
591
star
21

jsonnet-libs

Grafana Labs' Jsonnet libraries
Jsonnet
516
star
22

k6-operator

An operator for running distributed k6 tests.
Go
506
star
23

simple-json-datasource

Datasource that sends generic http requests to give url
JavaScript
502
star
24

awesome-k6

A curated list of awesome tools, content and projects using k6
493
star
25

carbon-relay-ng

Fast carbon relay+aggregator with admin interfaces for making changes online - production ready
Go
455
star
26

grizzly

A utility for managing Jsonnet dashboards against the Grafana API
Go
424
star
27

terraform-provider-grafana

Terraform Grafana provider
Go
391
star
28

grafana-image-renderer

A Grafana backend plugin that handles rendering of panels & dashboards to PNGs using headless browser (Chromium/Chrome)
TypeScript
335
star
29

dskit

Distributed systems kit
Go
316
star
30

xk6-browser

k6 extension that adds support for browser automation and end-to-end web testing via the Chrome Devtools Protocol
Go
310
star
31

worldmap-panel

Worldmap panel plugin for Grafana 3.0 that can be overlaid with circles for data points.
JavaScript
301
star
32

postman-to-k6

Converts Postman collections to k6 script code
JavaScript
286
star
33

xk6-dashboard

A k6 extension that makes k6 metrics available on a web-based dashboard.
HTML
278
star
34

grafana-json-datasource

A data source plugin for loading JSON APIs into Grafana.
TypeScript
261
star
35

k6-learn

JavaScript
255
star
36

k6-template-typescript

Template to use TypeScript with k6
TypeScript
250
star
37

grafonnet

Jsonnet library for generating Grafana dashboards.
Jsonnet
229
star
38

dashboard-linter

A tool to lint Grafana dashboards
Go
187
star
39

thema

A CUE-based framework for portable, evolvable schema
Go
185
star
40

tns

Observability Demo App
Jsonnet
185
star
41

intro-to-mltp

Introduction to Metrics, Logs, Traces and Profiles session companion code.
JavaScript
181
star
42

strava-datasource

Strava datasource for Grafana dashboard
TypeScript
171
star
43

xk6

Build k6 with extensions
Go
169
star
44

github-datasource

Grafana data source plugin using the Github API to retrieve and visualize Github data.
Go
169
star
45

grafana-plugin-sdk-go

A Go SDK for building backend plugins for Grafana
Go
165
star
46

jsonnet-language-server

A Language Server Protocol (LSP) server for Jsonnet (https://jsonnet.org)
Go
154
star
47

grafana-plugin-examples

Shell
152
star
48

django-saml2-auth

Django SAML2 Authentication Made Easy. Easily integrate with SAML2 SSO identity providers like Okta, Azure AD and others.
Python
151
star
49

cortex-tools

If you're using this tool with Grafana Mimir, please switch to "mimirtool" instead: https://github.com/grafana/mimir
Go
150
star
50

piechart-panel

Pie Chart Panel Plugin
JavaScript
150
star
51

grafana-plugin-repository

The plugin repository for plugins that are published on grafana.com.
JavaScript
147
star
52

mqtt-datasource

MQTT Datasource for Grafana allows streaming data from any MQTT broker running either locally or remotely.
Go
143
star
53

xk6-output-prometheus-remote

k6 extension to output real-time test metrics using Prometheus Remote Write.
Go
139
star
54

scribe

A tool for building elaborate CI pipelines using a familiar programming language
Go
124
star
55

kubernetes-diff-logger

Logs updates to Kubernetes Objects for storing and querying with Loki
Go
122
star
56

pyroscope-rs

Pyroscope Profiler for Rust. Profile your Rust applications.
Rust
119
star
57

synthetic-monitoring-agent

Synthetic Monitoring Agent
Go
118
star
58

har-to-k6

JSON config representation of K6 script
JavaScript
114
star
59

scenes

Build Grafana dashboards directly in your Grafana app plugins.
TypeScript
114
star
60

faro

Grafana Faro is a project for frontend application observability. It includes a highly configurable web SDK that instruments browser frontend applications to capture observability signals.
113
star
61

google-sheets-datasource

Load Google Sheets in grafana
Go
112
star
62

tutorials

A series of tutorials for helping you make the most out of Grafana.
Makefile
109
star
63

synthetic-monitoring-app

Synthetic Monitoring frontend application
TypeScript
107
star
64

grafana-api-golang-client

Grafana HTTP API Client for Go
Go
105
star
65

k6-action

k6 is now available as a GitHub Action
JavaScript
101
star
66

clickhouse-datasource

Grafana Plugin for ClickHouse
TypeScript
101
star
67

k8s-monitoring-helm

Shell
96
star
68

cuetsy

Experimental CUE->TypeScript exporter
Go
96
star
69

rollout-operator

Kubernetes Rollout Operator
Go
96
star
70

azure-monitor-datasource

Grafana data source for Azure Monitor/Application Insights (deprecated - now included in core Grafana)
TypeScript
92
star
71

dashboard-spec

Go
91
star
72

clock-panel

Clock Panel Plugin for Grafana
TypeScript
88
star
73

grafana-polystat-panel

D3-Based hexagon layout multi-stat panel
TypeScript
86
star
74

docker-otel-lgtm

Dockerfile
82
star
75

k6-docs

The k6 documentation website.
JavaScript
80
star
76

xk6-disruptor

Extension for injecting faults into k6 tests
Go
80
star
77

k6-template-es6

Template using Webpack and Babel to enable ES6 features in k6 tests
JavaScript
77
star
78

cortex-jsonnet

Deprecated: see https://github.com/grafana/mimir/tree/main/operations/mimir instead
Jsonnet
74
star
79

doom-datasource

Hackathon project
C
71
star
80

tutorial-environment

Environment for tutorial excercises
Go
70
star
81

pyroscope-go

This is the golang client integration for Pyroscope
Go
69
star
82

grafana-ansible-collection

grafana.grafana Ansible collection provides modules and roles for managing various resources on Grafana Cloud and roles to manage and deploy Grafana Agent and Grafana
Python
69
star
83

database-migrator

Code to export grafana.db (sqlite) to MySQL-compatible SQL file, to assist in migration of Grafana data to MySQL-compatible DB.
Shell
67
star
84

grafana-csv-datasource

A data source for loading CSV data into Grafana.
TypeScript
67
star
85

mimir-proxies

Proxies to help you ingest your metrics into Grafana Mimir.
Go
65
star
86

pyroscope-java

pyroscope java integration
Java
65
star
87

otel-profiling-go

Open Telemetry integration for Grafana Pyroscope and tracing solutions such as Grafana Tempo, Honeycomb, or Jaeger
Go
65
star
88

memo

easily save grafana annotations from slack mentions and the cli
Go
65
star
89

JPProf

Go Pprof but for Java runtime.
Java
65
star
90

grafana-starter-panel

A starter for Grafana panel plugins
TypeScript
65
star
91

xk6-sql

k6 extension to load test RDBMSs (PostgreSQL, MySQL, MS SQL and SQLite3)
Go
64
star
92

vscode-jsonnet

Full code support (formatting, highlighting, navigation, etc) for Jsonnet
JavaScript
64
star
93

jmeter-to-k6

Converts JMeter .jmx files to k6 JS code
JavaScript
63
star
94

xk6-distributed-tracing

A k6 extension for distributed tracing.
Go
62
star
95

github-to-es

GitHub Analytics With Elasticsearch And Grafana
JavaScript
54
star
96

opcua-datasource

An OPC UA datasource for reading from OPC UA servers (DA/HDA/AE) into Grafana directly
CSS
54
star
97

grafana-plugin-sdk-rust

Grafana Plugin SDK for Rust
Rust
53
star
98

xk6-kubernetes

Client extension for interacting with Kubernetes clusters from your k6 tests.
Go
52
star
99

regexp

Faster version of the Go regexp package
Go
51
star
100

influxdb-flux-datasource

Grafana datasource plugin for Flux (InfluxDB)
Go
51
star