Grafana Agent Flow mode Reference Components prometheus.exporter.redis
Open source


The prometheus.exporter.redis component embeds redis_exporter for collecting metrics from a Redis database.


prometheus.exporter.redis "LABEL" {
    redis_addr = "REDIS_ADDRESS"


The following arguments can be used to configure the exporter’s behavior. Omitted fields take their default values.

redis_addrstringAddress (host and port) of the Redis instance to connect to.yes
redis_userstringUser name to use for authentication (Redis ACL for Redis 6.0 and newer).no
redis_passwordsecretPassword of the Redis
redis_password_filestringPath of a file containing a
redis_password_map_filestringPath of a JSON file containing a map of Redis URIs to
namespacestringNamespace for the metrics."redis"no
config_commandstringWhat to use for the CONFIG command."CONFIG"no
check_keyslist(string)List of key-patterns to export value and length/size, searched for with
check_key_groupslist(string)List of Lua regular expressions (regex) for grouping
check_key_groups_batch_sizeintCheck key or key groups batch size hint for the underlying SCAN.10000no
max_distinct_key_groupsintThe maximum number of distinct key groups with the most memory utilization to present as distinct metrics per database.100no
check_single_keyslist(string)List of single keys to export value and length/
check_streamslist(string)List of stream-patterns to export info about streams, groups, and consumers to search for with
check_single_streamslist(string)List of single streams to export info about streams, groups, and
count_keyslist(string)List of individual keys to export counts
script_pathstringPath to Lua Redis script for collecting extra
script_pathslist(string)List of paths to Lua Redis scripts for collecting extra
connection_timeoutdurationTimeout for connection to Redis instance (in Golang duration format)."15s"no
tls_client_key_filestringName of the client key file (including full path) if the server requires TLS client
tls_client_cert_filestringName of the client certificate file (including full path) if the server requires TLS client
tls_ca_cert_filestringName of the CA certificate file (including full path) if the server requires TLS client
set_client_nameboolWhether to set client name to redis_exporter.trueno
is_tile38boolWhether to scrape Tile38-specific
is_clusterboolWhether the connection is to a Redis
export_client_listboolWhether to scrape Client List specific
export_client_portboolWhether to include the client’s port when exporting the client
redis_metrics_onlyboolWhether to just export metrics or to also export go runtime
ping_on_connectboolWhether to ping the Redis instance after
incl_system_metricsboolWhether to include system metrics (e.g. redis_total_system_memory_bytes).no
skip_tls_verificationboolWhether to to skip TLS

If redis_password_file is defined, it will take precedence over redis_password.

When check_key_groups is not set, no key groups are made.

The check_key_groups_batch_size argument name reflects key groups for backwards compatibility, but applies to both key and key groups.

The script_path argument may also be specified as a comma-separated string of paths, though it is encouraged to use script_paths when using multiple Lua scripts.

Any leftover key groups beyond max_distinct_key_groups are aggregated in the ‘overflow’ bucket.

The is_cluster argument must be set to true when connecting to a Redis cluster and using either of the check_keys and check_single_keys arguments.

Note that setting export_client_port increases the cardinality of all Redis metrics.

Exported fields

The following fields are exported and can be referenced by other components.

targetslist(map(string))The targets that can be used to collect redis metrics.

For example, targets can either be passed to a prometheus.relabel component to rewrite the metrics’ label set, or to a prometheus.scrape component that collects the exposed metrics.

Component health

prometheus.exporter.redis is only reported as unhealthy if given an invalid configuration. In those cases, exported fields retain their last healthy values.

Debug information

prometheus.exporter.redis does not expose any component-specific debug information.

Debug metrics

prometheus.exporter.redis does not expose any component-specific debug metrics.


This example uses a prometheus.scrape component to collect metrics from prometheus.exporter.redis:

prometheus.exporter.redis "example" {
  redis_addr = "localhost:6379"

// Configure a prometheus.scrape component to collect Redis metrics.
prometheus.scrape "demo" {
  targets    = prometheus.exporter.redis.example.targets
  forward_to = [ /* ... */ ]