How to add Redis as a datasource in Grafana and build customize dashboards for Analytics
The Redis Data Source for Grafana is a plug-in that allows users to connect to the Redis database and build dashboards in Grafana to easily monitor Redis and application data. It provides an out-of-the-box predefined dashboard, but also lets you build customized dashboards tuned to your specific needs.
Features and Capabilities
Grafana 7.1 and later with a new plug-in platform supported.
Data Source can connect to any Redis database. No special configuration is required.
Redis Cluster and Sentinel supported since version 1.2.
Data Source supports:
- Time Series: TS.GET, TS.INFO, TS.MRANGE, TS.QUERYINDEX, TS.RANGE
- Search and Query: FT.INFO
- Graph: GRAPH.QUERY, GRAPH.SLOWLOG
- Using Homebrew
- Docker
- Docker Compose
Using Homebrew
Step 1. Install Grafana
brew install grafana
Step 2. Install Redis Datasource
grafana-cli plugins install redis-datasource
The brew page downloads and untars the files into /usr/local/Cellar/grafana/version.
Step 3. Start Grafana service
brew services start grafana
Step 4. Access Grafana dashboard
Open https://IP:3000 to access grafana. The default username/password is admin/admin.
Step 5. Click "Configuration"
Step 6. Add Redis as a Data Source
Step 7. Select "Redis" as data source type
Step 8. Add Redis Database name, Endpoint URL and password
Assuming that you already have Redis server and database up and running in your infrastructure. You can also leverage Redis Enterprise Cloud as showcased in the below example.
Step 9. Click "Import" under Dashboard
Step 10.Access the Redis datasource Dashboard
Using Docker
You can install and run Grafana using the official Docker image.
Step 1. Install Docker
The first step is to install docker for your operating system. Run the docker version
command in a terminal window to make sure that docker is installed correctly.
On Windows and Mac, install docker version 18.03 or higher. You can run docker version
to find out your docker version.
Step 2. Run Grafana Docker container
Pass the plugins you want installed to Docker with the GF_INSTALL_PLUGINS environment variable as a comma-separated list. This sends each plugin name to grafana-cli plugins install ${plugin} and installs them when Grafana starts. In our case, we will be using redis-datasource.
docker run -d -p 3000:3000 --name=grafana -e "GF_INSTALL_PLUGINS=redis-datasource" grafana/grafana
Step 3. Accessing the grafana dashboard
Open https://IP:3000 to access grafana. The default username/password is admin/admin.
Step 4. Click "Configuration"
Step 5. Add Redis as a Data Source
Step 6. Select "Redis" as data source type
Step 7. Add Redis Database name, Endpoint URL and password
Assuming that you already have Redis server and database up and running in your infrastructure. You can also leverage Redis Enterprise Cloud as showcased in the below example.
Step 8. Click "Import" under Dashboard
Step 9.Access the Redis datasource Dashboard
Using Docker Compose
Assuming that Docker Compose is already installed in your system, follow the below steps:
Step 1. Clone the repository
git clone https://github.com/RedisGrafana/grafana-redis-datasource
cd grafana-redis-datasource
Step 2. Execute the docker-compose CLI
Project provides docker-compose.yml
to start Redis with all modules and Grafana.
docker-compose up -d
Step 3. Access Grafana dashboard
Step 4. Click "Configuration"
Step 5. Add Redis as a Data Source
Step 6. Select "Redis" as data source type
Step 7. Add Redis Database name, Endpoint URL and password
Assuming that you already have Redis server and database up and running in your infrastructure. You can also leverage Redis Enterprise Cloud as showcased in the below example.
Step 8. Click "Import" under Dashboard
Step 9.Access the Redis datasource Dashboard
Supported commands
Data Source supports various Redis commands using custom components and provides a unified interface to query any command.