Code Monkey home page Code Monkey logo

grafanaleaderboard-simplejson's Introduction

Grafana Leader Board

This creates a way to build a leaderboard into Grafana from a Redis Graph data source using Simple JSON

To run:

  1. Startup a Grafana Docker container
docker run --rm  -p 3000:3000 --name=grafana -e "GF_INSTALL_PLUGINS=redis-datasource,grafana-simple-json-datasource" grafana/grafana

  1. Startup this application
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Set any env vars - see below for more information
python3 app.py
  1. Add a simple JSON datasource

The URL will look like

http://<MY_IP_ADDRESS>:5000/

DataSource

  1. Add a New Table panel

Be sure to set the Table in the top right and bottom left

Panel

Environment variables

Variable Setting Default
REDIS_SERVER Name or IP of Redis Instance localhost
REDIS_PORT Redis Instance port 6379
REDIS_PASSWORD Redis Instance password ""
REDIS_LEADERBOARDS Comma separated list (optional) ""
REDIS_LEADERBOARD_SET Name of a Redis SET that holds all of the leaderboards to display ""
REDIS_SCANPREFIX Prefix of keys to scan for possible leaderboards ""
REDIS_TOPK The number of entries in the leaderboard 10

Note: if REDIS_LEADERBOARDS or REDIS_LEADERBOARD_SET is not set then the application will scan all redis keys with the SCANPREFIX looking for sorted sets. This is an expensive operation if you have lots of keys, so it's recommended that you set the REDIS_LEADERBOARDS if possible

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.