Prometheus exporter for Redis metrics.
This chart bootstraps a Redis exporter deployment on a Kubernetes cluster using the Helm package manager.
- Kubernetes 1.10+ with Beta APIs enabled
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
See helm repo for command documentation.
# Helm 3
$ helm install [RELEASE_NAME] prometheus-community/prometheus-redis-exporter
# Helm 2
$ helm install --name [RELEASE_NAME] prometheus-community/prometheus-redis-exporter
See configuration below.
See helm install for command documentation.
# Helm 3
$ helm uninstall [RELEASE_NAME]
# Helm 2
# helm delete --purge [RELEASE_NAME]
This removes all the Kubernetes components associated with the chart and deletes the release.
See helm uninstall for command documentation.
# Helm 3 or 2
$ helm upgrade [RELEASE_NAME] [CHART] --install
See helm upgrade for command documentation.
The default tag for the exporter image is now v1.x.x
. This major release includes changes to the names of various metrics and no longer directly supports the configuration (and scraping) of multiple redis instances; that is now the Prometheus server's responsibility. You'll want to use this dashboard now. Please see the redis_exporter github page for more details.
See Customizing the Chart Before Installing. To see all configurable options with detailed comments, visit the chart's values.yaml, or run these configuration commands:
# Helm 2
$ helm inspect values prometheus-community/prometheus-redis-exporter
# Helm 3
$ helm show values prometheus-community/prometheus-redis-exporter
For more information please refer to the redis_exporter documentation.
- To configure RabbitMQ connection set
redisAddress
string (example format:redis://myredis:6379
) - To configure auth by value, set
auth.enabled
totrue
, andauth.redisPassword
value - To configure auth by secret, set
auth.secret.name
andauth.secret.key
values
First, you need to deploy the script with a configmap. This is an example script from mentioned in the redis_exporter-image repository
apiVersion: v1
kind: ConfigMap
metadata:
name: prometheus-redis-exporter-script
data:
script: |-
-- Example collect script for -script option
-- This returns a Lua table with alternating keys and values.
-- Both keys and values must be strings, similar to a HGETALL result.
-- More info about Redis Lua scripting: https://redis.io/commands/eval
local result = {}
-- Add all keys and values from some hash in db 5
redis.call("SELECT", 5)
local r = redis.call("HGETALL", "some-hash-with-stats")
if r ~= nil then
for _,v in ipairs(r) do
table.insert(result, v) -- alternating keys and values
end
end
-- Set foo to 42
table.insert(result, "foo")
table.insert(result, "42") -- note the string, use tostring() if needed
return result
If you want to use this script for collecting metrics, you could do this by just set script.configmap
to the name of the configmap (e.g. prometheus-redis-exporter-script
) and script.keyname
to the configmap-key holding the script (eg. script
). The required variables inside the container will be set automatically.