<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Redis Exporter on Grafana Labs</title><link>https://grafana.com/oss/prometheus/exporters/redis-exporter/</link><description>Recent content in Redis Exporter on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/oss/prometheus/exporters/redis-exporter/index.xml" rel="self" type="application/rss+xml"/><item><title>Alerting rules</title><link>https://grafana.com</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://grafana.com</guid><description>&lt;p>This quickstart includes the following alerting rules:&lt;/p>
&lt;ul>
&lt;li>&lt;code>RedisDown&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>Redis instance is down&lt;/p>
&lt;ul>
&lt;li>&lt;code>RedisOutOfMemory&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>Redis is running out of memory&lt;/p>
&lt;ul>
&lt;li>&lt;code>RedisTooManyConnections&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>Redis has more than X connected clients&lt;/p>
&lt;a class="btn btn--primary br-5 mb-1" href="assets/redis_exporter_alerting_rules.yaml" rel="noopener noreferrer">Download the following alerting rules YAML file&lt;/a>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">groups:
- name: redis
rules:
- alert: RedisDown
annotations:
description: |-
Redis instance is down
VALUE = {{ $value }}
LABELS: {{ $labels }}
summary: Redis down (instance {{ $labels.instance }})
expr: redis_up == 0
for: 5m
labels:
severity: critical
- alert: RedisOutOfMemory
annotations:
description: |-
Redis is running out of memory (&amp;gt; 90%)
VALUE = {{ $value }}
LABELS: {{ $labels }}
summary: Redis out of memory (instance {{ $labels.instance }})
expr: redis_memory_used_bytes / redis_total_system_memory_bytes * 100 &amp;gt; 90
for: 5m
labels:
severity: warning
- alert: RedisTooManyConnections
annotations:
description: |-
Redis instance has too many connections
VALUE = {{ $value }}
LABELS: {{ $labels }}
summary: Redis too many connections (instance {{ $labels.instance }})
expr: redis_connected_clients &amp;gt; 100
for: 5m
labels:
severity: warning&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>This alerting rule YAML file was generated using the Redis Exporter &lt;a href="https://github.com/oliver006/redis_exporter/tree/master/contrib/redis-mixin" target="_blank" rel="noopener noreferrer">mixin&lt;/a>.&lt;/p></description></item><item><title>Cloud integration</title><link>https://grafana.com</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://grafana.com</guid><description>
&lt;div class="bg-solitude p-1 mb-1" style="">
&lt;p>Grafana Cloud comes with an ever-expanding set of integrations to quickly get an observability stack up and running in minutes. The Redis Integration, built-in to the Grafana Cloud Agent, exposes and scrapes essential Redis metrics and pushes them to Grafana Cloud. The agent will scrape metrics using an embedded Redis Exporter, and Grafana Cloud will automatically provision tailored Grafana dashboards and alerts for visualizing and acting on this data.&lt;/p>
&lt;div>
&lt;a class="btn btn--primary br-5 " href="/auth/sign-up/create-user?pg=oss-prom-redis-exporter-exporter&amp;amp;plcmt=body-txt-overview" rel="noopener noreferrer">Sign up for a free account to get started&lt;/a>
&lt;/div>
&lt;/div>
&lt;p>To learn more, check out the &lt;a href="/docs/grafana-cloud/integrations/">Grafana Cloud docs&lt;/a>.&lt;/p>
&lt;h4 id="how-it-works">How it works&lt;/h4>
&lt;p>Configuring, installing, connecting, and maintaining Prometheus monitoring components typically involves significant domain knowledge. It can take quite a while to go from setup to dashboard and alerts. As the creators of Grafana - and core contributors to Prometheus and Cortex - we build simple integrations to abstract some of this work away in order to quickly get started. How it works:&lt;/p>
&lt;ol>
&lt;li>Sign up (or log in) for a &lt;a href="/auth/sign-up/create-user?pg=oss-prom-redis-exporter-exporter&amp;amp;plcmt=body-txt-overview">free Grafana Cloud account&lt;/a>.&lt;/li>
&lt;li>Select the target you’d like to observe (an ever-expanding catalogue).&lt;/li>
&lt;li>Run a one-line command to install the Grafana Agent. The agent embeds and preconfigures Exporters to expose default metrics, and pushes them to the Grafana Cloud metrics backend.&lt;/li>
&lt;li>Voila! You’ll see tailored Grafana dashboards and will benefit from sane alerting defaults.&lt;/li>
&lt;/ol>
&lt;p>Looking for a different Exporter or integration? Check out our &lt;a href="/docs/grafana-cloud/integrations/">growing library of integrations for popular components&lt;/a> like MySQL, Postgres, Redis, Memcached and more.&lt;/p></description></item><item><title>Dashboards</title><link>https://grafana.com</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://grafana.com</guid><description>&lt;blockquote>
&lt;p>&lt;strong>Note:&lt;/strong> These dashboards may depend on the recording rules in the previous tab. Be sure to import these before importing the dashboards.&lt;/p>&lt;/blockquote>
&lt;h3 id="redis-dashboard">&lt;a href="/grafana/dashboards/14091">Redis Dashboard&lt;/a>&lt;/h3>
&lt;p>&lt;img
class="lazyload d-inline-block"
src="/api/dashboards/14091/images/10091/image"
alt="Redis Dashboard"/>&lt;/p>
&lt;p>This dashboard includes panels for the following metrics:&lt;/p>
&lt;ul>
&lt;li>Commands Per Second&lt;/li>
&lt;li>Commands Latency Per Second&lt;/li>
&lt;li>Hit Ratio Per Instance&lt;/li>
&lt;li>Total Memory Usage&lt;/li>
&lt;li>Memory Fragmantation Ratio Per Instance&lt;/li>
&lt;li>Key Evictions Per Second Per Instance&lt;/li>
&lt;li>Connected/Blocked Clients&lt;/li>
&lt;li>Total Items Per DB&lt;/li>
&lt;li>Expiring vs Non-Expiring Keys&lt;/li>
&lt;li>Connected Slaves Per Instance&lt;/li>
&lt;li>Time Since Last Master Connection&lt;/li>
&lt;/ul>
&lt;p>You can import the dashboard directly using the following dashboard ID: &lt;code>763&lt;/code>&lt;/p>
&lt;p>You can fetch the dashboard JSON &lt;a href="/api/dashboards/14091/revisions/1/download">&lt;strong>here&lt;/strong>&lt;/a>.&lt;/p>
&lt;p>This dashboard was generated using the Redis Exporter &lt;a href="https://github.com/oliver006/redis_exporter/tree/master/contrib/redis-mixin" target="_blank" rel="noopener noreferrer">mixin&lt;/a>.&lt;/p></description></item><item><title>Install</title><link>https://grafana.com</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://grafana.com</guid><description>&lt;h2 id="redis-exporter-quickstart">Redis Exporter Quickstart&lt;/h2>
&lt;p>In this guide you&amp;rsquo;ll learn how to set up and configure the Redis Exporter to collect Redis metrics like Redis uptime, commands executed per second and memory utilization, and expose them as Prometheus-style metrics. You&amp;rsquo;ll then configure &lt;a href="https://prometheus.io/" target="_blank" rel="noopener noreferrer">Prometheus&lt;/a> to scrape Redis metrics and optionally ship them to Grafana Cloud. Finally, you&amp;rsquo;ll set up a preconfigured and curated set of &lt;a href="https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/" target="_blank" rel="noopener noreferrer">recording rules&lt;/a>, Grafana &lt;a href="/grafana/dashboards">dashboards&lt;/a>, and &lt;a href="https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/" target="_blank" rel="noopener noreferrer">alerting rules&lt;/a>. At the end of this guide you&amp;rsquo;ll have dashboards that you can use to visualize your Redis metrics, and set of preconfigured alerts.&lt;/p>
&lt;p>If you&amp;rsquo;re using &lt;a href="/products/cloud/">Grafana Cloud&lt;/a>, the &lt;a href="/docs/grafana-cloud/integrations/integration-redis/">Redis&lt;/a> Integration can help you get up and running quickly. The Redis Integration embeds the Redis Exporter into the &lt;a href="https://github.com/grafana/agent" target="_blank" rel="noopener noreferrer">Grafana Cloud Agent&lt;/a> and automatically provisions alerting rules and dashboards, so you don&amp;rsquo;t have to run through the steps in this guide. To learn how to set up Redis Exporter using the Redis Integration, please see &lt;a href="/docs/grafana-cloud/integrations/integration-redis/">Redis Integration&lt;/a> from the Grafana Cloud docs.&lt;/p>
&lt;h2 id="prerequisites">Prerequisites&lt;/h2>
&lt;p>Before you get started, you should have the following available to you:&lt;/p>
&lt;ul>
&lt;li>A Redis Server and port 6379 reachable for Redis Exporter to connect to, see their &lt;a href="https://redis.io/download" target="_blank" rel="noopener noreferrer">downloads&lt;/a> page if you don&amp;rsquo;t have Redis installed.&lt;/li>
&lt;li>A Linux machine compatible with a Redis Exporter release. To see a list of available releases, please see &lt;a href="https://github.com/oliver006/redis_exporter/releases" target="_blank" rel="noopener noreferrer">Releases&lt;/a>.&lt;/li>
&lt;li>Prometheus running in your environment or directly on the machine. To learn how to install Prometheus, please see &lt;a href="https://prometheus.io/docs/prometheus/latest/installation/" target="_blank" rel="noopener noreferrer">Installation&lt;/a> from the Prometheus docs.&lt;/li>
&lt;li>Grafana running in your environment or directly on the machine. To learn how to install Grafana, please see &lt;a href="/docs/grafana/latest/installation/">Install Grafana&lt;/a> from the Grafana docs.&lt;/li>
&lt;li>(Optional) A Grafana Cloud account. Grafana Cloud hosts Grafana and a &lt;a href="/oss/mimir/">Mimir&lt;/a>-based Prometheus metrics endpoint. You will still need to scrape metrics, using either Prometheus installed in your environment, or the &lt;a href="https://github.com/grafana/agent" target="_blank" rel="noopener noreferrer">Grafana Cloud Agent&lt;/a>. To learn more about Grafana Cloud, please see &lt;a href="/products/cloud/">Grafana Cloud&lt;/a>.&lt;/li>
&lt;/ul>
&lt;h2 id="step-1-setting-up-redis-exporter">Step 1: Setting up Redis Exporter&lt;/h2>
&lt;p>In this step you&amp;rsquo;ll set up the Redis exporter on your machine to collect and expose Redis metrics in Prometheus format. This guide uses an Ubuntu 20.04 system with Redis Server v6.2.1. Steps may vary slightly depending on your operating system and Redis version.&lt;/p>
&lt;p>To begin, log in to your machine and download the relevant Redis Exporter binary. This guide uses the &lt;code>linux-amd64&lt;/code> binary but you should choose the one corresponding to your system&amp;rsquo;s OS and architecture:&lt;/p>
&lt;div class="code-snippet code-snippet__mini">&lt;div class="lang-toolbar__mini">
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;/div>&lt;div class="code-snippet code-snippet__border">
&lt;pre data-expanded="false">&lt;code class="language-none">wget https://github.com/oliver006/redis_exporter/releases/download/v1.18.0/redis_exporter-v1.18.0.linux-amd64.tar.gz&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>Replace &lt;code>v1.18.0&lt;/code> with the version you&amp;rsquo;d like to install. This guide may become stale so it&amp;rsquo;s best to check the Redis Exporter &lt;a href="https://github.com/oliver006/redis_exporter/releases" target="_blank" rel="noopener noreferrer">Releases&lt;/a> page for the latest stable version.&lt;/p>
&lt;p>Unzip the tarball and &lt;code>cd&lt;/code> into the directory:&lt;/p>
&lt;div class="code-snippet code-snippet__mini">&lt;div class="lang-toolbar__mini">
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;/div>&lt;div class="code-snippet code-snippet__border">
&lt;pre data-expanded="false">&lt;code class="language-none">tar xvfz redis_exporter-v1.18.0.linux-amd64.tar.gz
cd redis_exporter-v1.18.0.linux-amd64&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>When running the Redis Exporter, you need to specify the address of where your Redis Server is running. This may be different from your setup, by default the Redis Exporter will connect to localhost, but the address can be set by using the &lt;code>-redis.addr&lt;/code> flag.&lt;/p>
&lt;p>Finally, run the exporter:&lt;/p>
&lt;div class="code-snippet code-snippet__mini">&lt;div class="lang-toolbar__mini">
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;/div>&lt;div class="code-snippet code-snippet__border">
&lt;pre data-expanded="false">&lt;code class="language-none">./redis_exporter -redis.addr redis://localhost:6379&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;div class="code-snippet code-snippet__mini">&lt;div class="lang-toolbar__mini">
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;/div>&lt;div class="code-snippet code-snippet__border">
&lt;pre data-expanded="false">&lt;code class="language-none">INFO[0000] Redis Metrics Exporter v1.18.0 build date: 2021-03-11-03:26:58 sha1: d0597c841d2c9fa30ce8b6ded6251d1994822e27 Go: go1.16.1 GOOS: linux GOARCH: amd64
INFO[0000] Providing metrics at :9121/metrics&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>If you see the above output, you successfully ran Redis Exporter.&lt;/p>
&lt;p>Redis Exporter publishes Redis metrics in Prometheus format on port 9121. You can test this using &lt;code>curl&lt;/code>. You will need to open a new SSH session or background the Redis Exporter process to use &lt;code>curl&lt;/code>.&lt;/p>
&lt;div class="code-snippet code-snippet__mini">&lt;div class="lang-toolbar__mini">
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;/div>&lt;div class="code-snippet code-snippet__border">
&lt;pre data-expanded="false">&lt;code class="language-none">curl http://localhost:9121/metrics&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;div class="code-snippet code-snippet__mini">&lt;div class="lang-toolbar__mini">
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;/div>&lt;div class="code-snippet code-snippet__border">
&lt;pre data-expanded="false">&lt;code class="language-none">. . .
redis_cluster_connections 0
# HELP redis_cluster_enabled cluster_enabled metric
# TYPE redis_cluster_enabled gauge
redis_cluster_enabled 0
# HELP redis_commands_duration_seconds_total Total amount of time in seconds spent per command
# TYPE redis_commands_duration_seconds_total counter
redis_commands_duration_seconds_total{cmd=&amp;#34;client&amp;#34;} 1.7e-05
redis_commands_duration_seconds_total{cmd=&amp;#34;command&amp;#34;} 0.000443
redis_commands_duration_seconds_total{cmd=&amp;#34;config&amp;#34;} 0.000178
redis_commands_duration_seconds_total{cmd=&amp;#34;info&amp;#34;} 8.1e-05
redis_commands_duration_seconds_total{cmd=&amp;#34;latency&amp;#34;} 8e-06
redis_commands_duration_seconds_total{cmd=&amp;#34;set&amp;#34;} 1.7e-05
redis_commands_duration_seconds_total{cmd=&amp;#34;slowlog&amp;#34;} 1.4e-05
# HELP redis_commands_processed_total commands_processed_total metric
# TYPE redis_commands_processed_total counter
redis_commands_processed_total 10&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>If you see the above output, you&amp;rsquo;re ready to begin scraping Redis metrics using Prometheus.&lt;/p>
&lt;p>To avoid running and managing Redis Exporter from the command line, you can create a &lt;code>systemd&lt;/code> service. To learn how to do this, please see &lt;a href="/docs/grafana-cloud/agent/agent_as_service/">Creating a systemd service to manage the agent&lt;/a>. Replace the path to the agent binary with the path to Redis Exporter.&lt;/p>
&lt;p>Redis Exporter provides features such as:&lt;/p>
&lt;ul>
&lt;li>Authenticating against Redis&lt;/li>
&lt;li>TLS configuration&lt;/li>
&lt;li>Redis-only metrics&lt;/li>
&lt;/ul>
&lt;p>And much more. To learn more about these features, please see the &lt;a href="https://github.com/oliver006/redis_exporter" target="_blank" rel="noopener noreferrer">Redis Exporter GitHub repository&lt;/a>.&lt;/p>
&lt;h2 id="step-2-scraping-redis-exporter-using-prometheus">Step 2: Scraping Redis Exporter using Prometheus&lt;/h2>
&lt;p>Now that the Redis Exporter is up and running on your machine, you can configure a Prometheus scrape job to collect and store Redis Exporter metrics.&lt;/p>
&lt;p>Add the following scrape job config to the &lt;code>scrape_configs&lt;/code> section of your &lt;code>prometheus.yml&lt;/code> configuration file:&lt;/p>
&lt;div class="code-snippet code-snippet__mini">&lt;div class="lang-toolbar__mini">
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;/div>&lt;div class="code-snippet code-snippet__border">
&lt;pre data-expanded="false">&lt;code class="language-none">- job_name: redis
static_configs:
- targets: [&amp;#39;redis_exporter_machine_IP_address:9121&amp;#39;]&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>Replace &lt;code>redis_exporter_machine_IP_address&lt;/code> with the IP address of the machine running Redis Exporter. If you&amp;rsquo;re running Prometheus on the same machine, this will be &lt;code>localhost&lt;/code>. To learn more about configuring Prometheus, please see &lt;a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/" target="_blank" rel="noopener noreferrer">Configuration&lt;/a> from the Prometheus docs.&lt;/p>
&lt;p>If you don&amp;rsquo;t have a &lt;code>prometheus.yml&lt;/code> configuration file, create a simple one using your favorite text editor. Open your preferred text editor and paste in the following Prometheus configuration:&lt;/p>
&lt;div class="code-snippet code-snippet__mini">&lt;div class="lang-toolbar__mini">
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;/div>&lt;div class="code-snippet code-snippet__border">
&lt;pre data-expanded="false">&lt;code class="language-none">global:
scrape_interval: 15s
scrape_configs:
- job_name: redis
static_configs:
- targets: [&amp;#39;redis_exporter_machine_IP_address:9121&amp;#39;]&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>This configuration tells Prometheus to scrape all jobs every 15 seconds. The only configured scrape job is called &lt;code>redis-exporter&lt;/code> and defines a &lt;code>redis_exporter_machine_IP_address:9121&lt;/code> target. By default, Prometheus will scrape the &lt;code>/metrics&lt;/code> endpoint using HTTP.&lt;/p>
&lt;p>Save and close the file. You can then run Prometheus with the file using the following command:&lt;/p>
&lt;div class="code-snippet code-snippet__mini">&lt;div class="lang-toolbar__mini">
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;/div>&lt;div class="code-snippet code-snippet__border">
&lt;pre data-expanded="false">&lt;code class="language-none">./prometheus --config.file=./prometheus.yml&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h3 id="shipping-metrics-to-grafana-cloud">Shipping metrics to Grafana Cloud&lt;/h3>
&lt;p>To ship Redis Exporter metrics to Grafana Cloud from Prometheus, configure the &lt;code>remote_write&lt;/code> parameter in your &lt;code>prometheus.yml&lt;/code> configuration file. To learn more, please see &lt;a href="/docs/grafana-cloud/metrics/prometheus/">Metrics — Prometheus&lt;/a> from the Grafana Cloud docs. To learn more about the &lt;code>remote_write&lt;/code> parameter, please see &lt;a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write" target="_blank" rel="noopener noreferrer">&lt;code>remote_write&lt;/code>&lt;/a> from the Prometheus docs.&lt;/p>
&lt;h2 id="step-3-configure-recording-rules">Step 3: Configure recording rules&lt;/h2>
&lt;p>Using recording rules, you can precompute and cache frequently queried metrics. For example, if a dashboard panel uses a computationally intensive query like a &lt;code>rate()&lt;/code>, you can create a recording rule that runs at a regular reduced interval and saves the result of the intensive query in a new time series. This avoids fetching and computing data every time the dashboard gets refreshed. To learn more about Prometheus recording rules, please see &lt;a href="https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/" target="_blank" rel="noopener noreferrer">Recording Rules&lt;/a> from the Prometheus docs.&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Note:&lt;/strong> You should load the following recording rules before loading the dashboards in this guide.&lt;/p>&lt;/blockquote>
&lt;p>The dashboard queries and alerting rules use recording rules to reduce load on the Prometheus or Grafana Cloud Metrics servers, depending on where you&amp;rsquo;re evaluating the rules.&lt;/p>
&lt;p>You can fetch the recording rule YAML file &lt;a href="?tab=recording-rules">here&lt;/a>.&lt;/p>
&lt;p>This recording rule YAML file was generated using the Redis Exporter &lt;a href="https://github.com/oliver006/redis_exporter/tree/master/contrib/redis-mixin" target="_blank" rel="noopener noreferrer">mixin&lt;/a>.&lt;/p>
&lt;h3 id="load-recording-rules-into-prometheus">Load recording rules into Prometheus&lt;/h3>
&lt;p>To load recording rules into Prometheus, add the following to your &lt;code>prometheus.yml&lt;/code> configuration file:&lt;/p>
&lt;div class="code-snippet code-snippet__mini">&lt;div class="lang-toolbar__mini">
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;/div>&lt;div class="code-snippet code-snippet__border">
&lt;pre data-expanded="false">&lt;code class="language-none">rule_files:
- &amp;#34;redis_exporter_recording_rules.yml&amp;#34;&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>Be sure to replace &lt;code>redis_exporter_recording_rules.yml&lt;/code> with the path to your Redis Exporter recording rules YAML file.&lt;/p>
&lt;h3 id="load-recording-rules-into-grafana-cloud">Load recording rules into Grafana Cloud&lt;/h3>
&lt;p>To learn how to load recording rules into Grafana Cloud, please see &lt;a href="/docs/grafana-cloud/alerts/alerts-rules/#prometheus-and-loki-rules-with-cortextool">Prometheus and Loki rules with cortextool&lt;/a>.&lt;/p>
&lt;h2 id="step-4-configuring-dashboards">Step 4: Configuring dashboards&lt;/h2>
&lt;p>This quickstart includes the following dashboard:&lt;/p>
&lt;ul>
&lt;li>Redis Dashboard for Prometheus Redis Exporter&lt;/li>
&lt;/ul>
&lt;p>To learn how to import these dashboards into Grafana, please see &lt;a href="/docs/grafana/latest/dashboards/export-import/#importing-a-dashboard">Importing a dashboard&lt;/a> from the Grafana docs.&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Note:&lt;/strong> These dashboard queries may depend on the recording rules defined in the previous step. Be sure to import these before importing the dashboards.&lt;/p>&lt;/blockquote>
&lt;p>You can fetch the dashboards &lt;a href="?tab=dashboards">here&lt;/a>.&lt;/p>
&lt;h2 id="step-5-configuring-alerts">Step 5: Configuring alerts&lt;/h2>
&lt;p>With Prometheus alerting rules, you can define alerts that fire when PromQL expressions breach some threshold or satisfy specified conditions over a period of time. For example, you can define a &lt;code>HighRequestLatency&lt;/code> alert that fires when a request latency metric is greater than some threshold over a period of time. As soon as the alerting condition is triggered, the alert moves into &lt;code>Pending&lt;/code> state. After satisfying the condition for the period of time defined by the &lt;code>for&lt;/code> parameter, the alert moves into &lt;code>Firing&lt;/code> state. You can configure routing and notifications for firing alerts using a tool like &lt;a href="https://prometheus.io/docs/alerting/latest/alertmanager/" target="_blank" rel="noopener noreferrer">Alertmanager&lt;/a>. Alertmanager is also built-in to Grafana Cloud.&lt;/p>
&lt;p>You can fetch the alerting rule YAML file &lt;a href="?tab=alerting-rules">here&lt;/a>.&lt;/p>
&lt;h3 id="load-alerting-rules-into-prometheus">Load alerting rules into Prometheus&lt;/h3>
&lt;p>To load alerting rules into Prometheus, add the following to your &lt;code>prometheus.yml&lt;/code> configuration file:&lt;/p>
&lt;div class="code-snippet code-snippet__mini">&lt;div class="lang-toolbar__mini">
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;/div>&lt;div class="code-snippet code-snippet__border">
&lt;pre data-expanded="false">&lt;code class="language-none">rule_files:
- &amp;#34;redis_exporter_alerting_rules.yml&amp;#34;&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>Be sure to replace &lt;code>redis_exporter_alerting_rules.yml&lt;/code> with the path to your Redis alerting rules YAML file.&lt;/p>
&lt;h3 id="load-alerting-rules-into-grafana-cloud">Load alerting rules into Grafana Cloud&lt;/h3>
&lt;p>To learn how to load alerting rules into Grafana Cloud, please see &lt;a href="/docs/grafana-cloud/alerts/alerts-rules/#prometheus-and-loki-rules-with-cortextool">Prometheus and Loki rules with cortextool&lt;/a>.&lt;/p>
&lt;h2 id="conclusion">Conclusion&lt;/h2>
&lt;p>In this quickstart you installed and ran Redis Exporter on your Linux machine. You then configured Prometheus to scrape the Redis metrics exposed by Redis Exporter. You loaded recording rules and alerting rules into Prometheus, and finally imported Grafana dashboards to visualize your Redis metrics.&lt;/p>
&lt;p>If you&amp;rsquo;re using Grafana Cloud, you can skip all of the steps in this guide by installing the Redis integration with the Grafana Cloud Agent. This integration embeds a preconfigured Redis Exporter into the agent and automatically provisions Grafana dashboards and Prometheus alerting and recording rules, so you don&amp;rsquo;t have to import them manually. To learn how to set up the Redis integration, please see &lt;a href="/docs/grafana-cloud/integrations/">Grafana Cloud Integrations&lt;/a>.&lt;/p>
&lt;p>The dashboards, recording rules, and alerting rules were generated using the Redis Exporter Mixin. Mixins are reusable templates for dasboards, recording rules, and alerts curated and designed by subject matter experts. To learn more, please see the &lt;a href="https://github.com/oliver006/redis_exporter/tree/master/contrib/redis-mixin" target="_blank" rel="noopener noreferrer">Redis Mixin&lt;/a> repository.&lt;/p></description></item><item><title>Recording rules</title><link>https://grafana.com</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://grafana.com</guid><description>&lt;blockquote>
&lt;p>&lt;strong>Note:&lt;/strong> You should load the following recording rules before loading the dashboards in this guide. The dashboard queries use recording rules to reduce load on the Prometheus or Grafana Cloud Metrics servers, depending on where you&amp;rsquo;re evaluating the rules.&lt;/p>&lt;/blockquote>
&lt;p>This quickstart includes the following recording rules:&lt;/p>
&lt;ul>
&lt;li>&lt;code>redis_memory_fragmentation_ratio&lt;/code>&lt;/li>
&lt;/ul>
&lt;a class="btn btn--primary br-5 mb-1" href="assets/redis_exporter_recording_rules.yaml" rel="noopener noreferrer">Download the following recording rules YAML file&lt;/a>
&lt;div class="code-snippet code-snippet__mini">&lt;div class="lang-toolbar__mini">
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;/div>&lt;div class="code-snippet code-snippet__border">
&lt;pre data-expanded="false">&lt;code class="language-none">groups:
- name: redis_rules
rules:
- expr: redis_memory_used_rss_bytes / redis_memory_used_bytes
record: redis_memory_fragmentation_ratio&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>This recording rule YAML file was generated using the Redis Exporter &lt;a href="https://github.com/oliver006/redis_exporter/tree/master/contrib/redis-mixin" target="_blank" rel="noopener noreferrer">mixin&lt;/a>.&lt;/p></description></item></channel></rss>