Supported telemetry types
The Redis integration supports these telemetry types:Prerequisites
The Redis integration has the following prerequisites:-
Make port
6379, or your custom Redis port, reachable from the CXDOT Collector over TCP. The integration doesn’t support Unix domain sockets. -
If your Redis servers require authentication, prepare credentials for the CXDOT
Collector. On a server protected only by the
requirepasspassword, the Collector authenticates with that password, so you don’t need to create a user. On a server that uses an access control list (ACL), connect withredis-clias a user that can manage users, and create a user that can run only the commands the Collector sends:ReplacePASSWORDwith a password for this user. The examples on this page use the usernamecxdot. If you choose another username, use it in the configuration too. To keep the user after the server restarts, runACL SAVEif the server loads its users from an ACL file, orCONFIG REWRITEif it loads them from its configuration file. The optional collections in the Configure section use more commands. Collecting connections per client name needs+client|list. Collecting key lengths needs+type +llen +scard +zcard +hlen +xlen,+scanwhenkeyscontains a glob pattern, read access to the keys you list (for example,'%R~queue:*'), and+selectwhen the keys are in databases other than0. A key that the user can’t read doesn’t report a length. Per-command statistics come fromINFOand need no extra permission. On Redis 7.2 or greater, theredis.acl.deniedmetric counts the requests that ACL rules deny, including requests from the Collector. Each collection that reads a key the user can’t read counts a denial withredis.acl.denied.reasonset tokey. Each time the Collector connects, it sendsCLIENT SETINFOto report its client library name. The Collector doesn’t depend on this command, but each deniedCLIENT SETINFOcounts with thecmdreason and appears in the ACL log, so that count climbs on every connection. To keep these denials out ofredis.acl.deniedand the ACL log, also grant+client|setinfo. Redis versions before 7.2 reject+client|setinfo, so omit it on those versions.
Configure
The Redis integration is enabled by default. It collects from each Redis server independently, whether the server is a standalone server, a primary, or a replica, and whether or not it runs in cluster mode. The Collector doesn’t follow cluster redirects or discover other nodes from the servers it finds. Make sure that the Collector discovers each node that you want to monitor, or list the node as a static target.Configure on Kubernetes
To configure the Redis integration in Kubernetes, follow these steps:-
Choose how the CXDOT Collector finds your Redis pods. For more information, see
autodiscovery.
- For Redis pods that listen on port
6379, add theapp.kubernetes.io/name: redislabel to the pod template. The Collector uses the same credentials, which you set in the next step, for every pod that it finds by label. - For Redis pods and Services that use another port, or that need their own credentials or TLS settings, provide the address, credentials, and TLS settings through autodiscovery annotations for Redis. A pod with annotations uses its annotation settings, even if it also carries the label. Annotate a Service only when it routes to a single Redis server. If a Service balances traffic across several Redis pods, its metrics mix readings from different servers, because the Collector holds more than one connection to each target and can reconnect at any time. For more than one server, annotate each pod instead.
- For Redis pods that listen on port
-
Optional: Set the credentials for Redis pods that you label and that require a
password, and provide the password through your deployment’s secret management. The
node Collector on each pod’s node collects from the pods that it finds by label, so
provide the password through
nodeCollector.extraEnv. For more information about Collector tiers, see architecture. For example, the following Helm values read the password from a Kubernetes secret into theREDIS_PASSWORDenvironment variable:Omitusernamewhen the servers use only therequirepasspassword. A password-protected server that the Collector finds by label reports as unreachable until these credentials match it. Give a server with different credentials its own annotations, or list it as a static target in a second integration instance with its own credentials. -
Optional: Configure static targets for Redis servers that the Collector doesn’t
discover, such as servers outside your Kubernetes cluster. For example, add the
following to the Helm values file for your CXDOT Collector:
When you configure static targets, this integration instance collects from exactly those targets instead of discovered targets. Static targets use the integration’s
username,password, andtlssettings. The cluster Collector collects from static targets, so provide any password environment variable throughclusterCollector.extraEnv. -
Optional: Collect per-command statistics, open connections per client name, or the
lengths of specific keys. These collections are off by default. For example, add the
following to the Helm values file for your CXDOT Collector:
Each of these options adds work for the Redis server at every collection interval. A glob pattern in
keys, such asqueue:*, scans every key in each database that holds keys, so on a server with many keys, list key names rather than patterns where you can. Servers that the Collector finds by annotation use the settings in their annotations instead. -
Optional: Configure a second integration instance to collect from both discovered
and static targets, or to use different credentials for some static targets. For
example, add the following to the Helm values file for your CXDOT Collector:
The
redis/externalkey defines a named instance for the static targets, with its own credentials. The barerediskey continues to collect from discovered targets. ProvideEXTERNAL_REDIS_PASSWORDthroughclusterCollector.extraEnv. -
Optional: Disable the integration. For example, add the following to the Helm values
file for your CXDOT Collector:
Configure on a host
To configure the Redis integration on a host outside Kubernetes, such as a virtual machine, install the CXDOT Collector on Linux on each Redis host in host mode and list the local server. For example, add the following to the Collector configuration file:REDIS_PASSWORD environment variable of the
Collector process. On a host, the integration collects only from the servers in
instances. The Collector adds the host’s host.name attribute to every metric. When
every endpoint is localhost, host.name identifies the server. To collect from more
than one server on a host, such as several cluster nodes on different ports, list each
one.
Validate
To validate the Redis integration, follow these steps:-
In Live Telemetry Analyzer, filter for
__name__=cxdot.integration.target.healthandcxdot.integration.name=redis. Confirm that each expected target reports1. A value of0means that the Collector couldn’t connect to the server, authenticate, or runPINGandINFO. Use theserver.addressandserver.portattributes, andhost.nameon hosts, to identify each target. -
In Metrics Explorer, run the following query:
Confirm that the query returns one time series per target.
Troubleshooting
-
A target reports
0and the Collector logsNOAUTH Authentication requiredorWRONGPASS: The server requires credentials that the Collector didn’t send or that don’t match. Static targets and servers that the Collector finds by label use the integration’susernameandpassword. Servers that the Collector finds by annotation use the credentials in their annotations. - Some metrics are missing from a Valkey server: The integration collects from Valkey, a fork of Redis, on a best-effort basis. Metrics that Valkey reports differently from Redis might be missing.
-
A target reports
0for a while after the Redis server starts: A server that loads its dataset from disk at startup rejectsPINGuntil loading finishes, so the Collector reports it as unreachable until then. -
Metrics don’t carry the server’s primary or replica role: The Collector reports the
role once per server, as the
redis.rolemetric with aroleattribute, so promoting a replica doesn’t start new time series for every metric. To filter by role, join on the server’s identity. For example, the following query returns memory use for primaries only: -
Slow log metrics don’t include entries from before the Collector started: The
redis.slowlog.durationhistogram counts each slow log entry once. It starts from the newest slow log entry when the Collector first reads the slow log, and starts again after the Redis server restarts or the Collector reaches a different server. Each collection reads at most the newest 128 entries, so the histogram counts only part of a burst of more than 128 slow commands within one collection interval.
Configuration reference
Configure one Redis integration instance with the following settings. In Helm values, place these settings underconfig.integrations.redis. In a Collector configuration file, place them
under cxdot.integrations.redis.
Optional settings
-
enabledType:boolean. Optional. Default:true. Whether to run the Redis integration. If true, the Collector collects Redis metrics. If false, the Collector doesn’t run this integration. -
usernameType:string. Optional. Default: empty string. Redis ACL username for connections to static targets and targets that the Collector finds by label. Leave empty to authenticate as the Redisdefaultuser. Targets that the Collector finds by annotation use the credentials in their annotations instead. -
passwordType:string. Optional. Redis password for connections to static targets and targets that the Collector finds by label: therequirepasspassword, or the ACL user’s password whenusernameis set. A target that requires a password the Collector doesn’t send reports as unreachable. Targets that the Collector finds by annotation use the credentials in their annotations instead. The Collector masks this value in diagnostic output, logs, and errors. -
collection_intervalType:duration. Optional. Default:10s. Time between metric collections from each static target and each target that the Collector finds by label. Targets that the Collector finds by annotation use the collection interval their annotations set. -
timeoutType:duration. Optional. Default:10s. Maximum time allowed to collect metrics from one Redis target. The value must not exceedcollection_interval. -
instancesType:array of object. Optional. Default:[]. Static Redis targets. Each entry’sendpointishost:port, for example,redis.default.svc:6379. When this list isn’t empty, the integration collects from exactly these targets instead of discovered targets. On a host, the integration collects only from this list. In a Redis Cluster, list every node: each node reports only its own state, and the Collector doesn’t discover other nodes from the one you list. -
instances[].endpointType:string. Required. Redis target inhost:portformat. -
command_statsType:boolean. Optional. Default:false. Whether to collect per-command statistics from theINFO commandstatssection: the number of calls to each command and the CPU time spent running it. If true, the Collector reportsredis.cmd.callsandredis.cmd.usec, with one time series for each command that the server has run. If false, the Collector doesn’t report them. Targets discovered through annotations use thecommand_statssetting in their annotations instead. -
collect_client_metricsType:boolean. Optional. Default:false. Whether to count the open connections to each target by the name that clients set withCLIENT SETNAME. If true, the Collector runsCLIENT LISTat each collection and reportsredis.clients.connection.count, counting connections without a name asunknown. If false, the Collector doesn’t runCLIENT LIST. TheCLIENT LISTreply grows with the number of connections. Targets that the Collector finds by annotation use thecollect_client_metricssetting in their annotations instead. -
keysType:array of string. Optional. Default:[]. Keys whose lengths the Collector reports asredis.key.length. Each entry is a key name or a glob pattern. An entry that contains*,?, or[without a preceding backslash is a glob pattern. The length is the number of elements in a list, set, sorted set, hash, or stream, and1for a string. Each collection reads every listed key in every database that holds keys, or only indbwhen it’s set. A glob pattern scans every key in each database that the Collector reads, so its cost grows with the number of keys on the server. When the reads don’t finish withintimeout, that collection reports no key lengths. A listed key that has no elements in any database reports0. Targets that the Collector finds by annotation use thekeyssetting in their annotations instead. -
dbType:integer. Optional. Minimum:0. Number of the database to readkeysfrom. If omitted, the Collector reads every database that holds keys. If this database holds no keys, the Collector reports no key lengths. Onlykeysuses this setting, because every other metric covers the whole server. -
warn_on_missing_keysType:boolean. Optional. Default:true. Whether to log a warning for each entry inkeysthat has no elements in any database that the Collector reads. If true, the Collector logs the warning at each collection. If false, the Collector reports a length of0for the entry without logging a warning. -
tlsType:object. Optional. TLS settings for connections to static targets and targets that the Collector finds by label. TLS is on wheninsecureisfalseor the block setsca_fileorca_pem. With TLS on, the Collector verifies the server certificate unlessinsecure_skip_verifyistrue. Targets that the Collector finds by annotation use the TLS settings in their annotations instead. -
tls.ca_fileType:string. Optional. Path to a PEM-encoded certificate authority (CA) certificate file used to verify the Redis server certificate. If omitted, the Collector uses the system certificate authority pool. -
tls.ca_pemType:string. Optional. PEM-encoded certificate authority certificate content used to verify the Redis server certificate. -
tls.cert_fileType:string. Optional. Path to the PEM-encoded client certificate file to present to the Redis server. A Redis server with TLS enabled requires a client certificate unless itstls-auth-clientssetting isnooroptional. -
tls.cert_pemType:string. Optional. PEM-encoded client certificate content to present to the Redis server, in place ofcert_file. -
tls.cipher_suitesType:array of string. Optional. TLS 1.0 through 1.2 cipher suites that the Collector can use. The order of the list doesn’t matter, and TLS 1.3 cipher suites aren’t configurable. If omitted, the Collector uses the secure defaults from the Go TLS library. For supported names, see https://go.dev/src/crypto/tls/cipher_suites.go. -
tls.curve_preferencesType:array of string. Optional. Key exchange mechanisms that the Collector can use in the TLS handshake: the elliptic curvesP256,P384,P521, andX25519, andX25519MLKEM768, a hybrid post-quantum key exchange. The order of the list doesn’t matter: the Collector chooses among the listed mechanisms by its own preference. If omitted, the Collector uses the Go TLS library defaults. -
tls.include_system_ca_certs_poolType:boolean. Optional. Whether to add certificates from the system certificate authority pool to the configured certificate authorities. If true, the Collector trusts both sources. If false, the Collector trusts only the configured certificate authorities. -
tls.insecureType:boolean. Optional. Default:true. Whether to connect to Redis without TLS. If true and neitherca_filenorca_pemis set, the Collector uses an unencrypted connection. If false, or ifca_fileorca_pemis set, the Collector connects over TLS. -
tls.insecure_skip_verifyType:boolean. Optional. Whether to skip verification of the Redis server certificate. If true, the connection is encrypted but isn’t authenticated and is vulnerable to machine-in-the-middle attacks. If false, the Collector verifies the certificate. Applies only when TLS is on. -
tls.key_fileType:string. Optional. Path to the PEM-encoded client private key file used withcert_filefor mutual TLS authentication. -
tls.key_pemType:string. Optional. PEM-encoded client private key content used withcert_pemfor mutual TLS authentication. -
tls.max_versionType:string. Optional. Maximum TLS protocol version the Collector can use. If omitted, the Collector uses the maximum version supported by the Go TLS library. -
tls.min_versionType:string. Optional. Minimum TLS protocol version the Collector can use. If omitted, the minimum version is TLS 1.2. -
tls.reload_intervalType:duration. Optional. How often the Collector reloads certificate and key files. If omitted, the Collector doesn’t reload the files. -
tls.server_name_overrideType:string. Optional. Server name to verify in the Redis server certificate instead of the endpoint hostname. Use this setting when the certificate name differs from the endpoint hostname. -
tls.tpmType:object. Optional. Trusted platform module settings for the TLS private key. -
tls.tpm.authType:string. Optional. Authorization value for the trusted platform module key. -
tls.tpm.enabledType:boolean. Optional. Whether to use a trusted platform module for the TLS private key. If true, the Collector loads the key from the configured device or socket. If false, the Collector uses the configured key file or in-memory key. -
tls.tpm.owner_authType:string. Optional. Owner authorization value for the trusted platform module. -
tls.tpm.pathType:string. Optional. Path to the trusted platform module device or Unix domain socket, such as/dev/tpm0or/dev/tpmrm0.