Our Redis integration reports critical performance data from your Redis server to New Relic products. You can view this metric data and inventory data in pre-built dashboards, create alert policies, and create custom queries and charts. You can also specify keys that are important to your application and get information about their length.
Read on to install the integration, and to see what data we collect.
Compatibility and requirements
Our integration is compatible with Redis versions from 3.0 to 7.0.
Before installing the integration, make sure that you meet the following requirements:
- A New Relic account. Don't have one? Sign up for free! No credit card required.
- If Redis is not running on Kubernetes or Amazon ECS, you must install the infrastructure agent on a Linux OS host that's running Redis. Otherwise:
- If running on Kubernetes, see these requirements.
- If running on ECS, see these requirements.
The integration obtains data by executing Redis commands:
INFO
command: Data from the INFO command populates metric data and some inventory data.CONFIG GET
command: Most inventory data comes from this command.- In managed Redis installations without permissions to execute the
CONFIG
command (for example, AWS ElastiCache), the execution of this command can be disabled with theconfig_inventory: false
configuration option.
- In managed Redis installations without permissions to execute the
- Key length acquisition: Depending on the type of key, these commands are used:
For key length data collection, the agent uses pipelining to minimize the impact on your Redis performance. However, if you are collecting the length of many keys, your Redis performance may be affected. For this reason, the agent includes a default key limit (but this limit can be overwritten).
Important
If you edited the names of the Redis commands mentioned above, the integration will not be able to retrieve the Redis data.
Quick start
Instrument your Redis server quickly and send your telemetry data with guided install. Our guided install creates a customized CLI command for your environment that downloads and installs the New Relic CLI and the infrastructure agent.
Ready to get started? Click one of these buttons to try it out.
Install and activate
To install the Redis integration, follow the instructions for your environment:
Additional notes:
- Advanced: Integrations are also available in tarball format to allow installation outside of a package manager.
- On-host integrations do not automatically update. For best results, regularly update the integration package and the infrastructure agent.
Did this doc help with your installation?
Create a New Relic user for your Redis server
If you're using Redis 6+ and using access control lists (ACLs) to control access to your instance, you may want to create a newrelic
user for the integration. Use this command to create and grant the required permissions to your user:
$ACL SETUSER newrelic on >'YOUR_SELECTED_PASSWORD' ~* +INFO +CONFIG|GET +SELECT +TYPE +LLEN +SCARD +ZCOUNT +HLEN
Configure the integration
There are several ways to configure the integration, depending on how it was installed:
- If enabled via Kubernetes: see Monitor services running on Kubernetes.
- If enabled via Amazon ECS: see Monitor services running on ECS.
- If installed on-host: edit the config in the integration's YAML configuration file
redis-config.yml
.
Use the YAML configuration to place required login credentials and configure how your data is collected, depending on your setup and preference.
The configuration file has common settings applicable to all integrations, like interval
, timeout
, inventory_source
. To learn more about these common settings, see our YAML configuration format.
Important
If you're still using our legacy configuration/definition files, use our older, standard configuration foramt.
Specific settings related to Redis are defined using the env
section of the configuration file. These settings control the connection to your Redis instance as well as other security settings and features.
Redis instance settings
The Redis integration collects both Metrics(M) and Inventory(I) information. In the table, use the Applies To column for the settings available to each collection:
Setting | Description | Default | Applies To |
---|---|---|---|
| Redis server hostname. |
| M/I |
| Port where Redis server is listening. |
| M/I |
| Username to use when connecting to the Redis server. Use only with Redis 6+ if ACL is enabled. | N/A | M/I |
| Password to use when connecting to the Redis server. Use only with Redis
servers if | N/A | M/I |
| Path to Unix socket file on which Redis server is listening. Use this instead of Hostname/Port. | N/A | M/I |
| Set to |
| M/I |
| Use TLS when communicating with the Redis server. |
| M/I |
| Disable server name verification when connecting over TLS. |
| M/I |
| List of the keys for retrieving their lengths. | N/A | M |
| Max number of keys to retrieve their lengths. |
| M |
| Set to 'false' in environments where the Redis CONFIG command is not allowed (for example, AWS or ElastiCache). |
| I |
| Map default Redis commands to their renamed form. | N/A | M/I |
Enable multi-tenancy monitoring. |
| M/I | |
| Set to |
| |
| Set to |
|
The values for these settings can be defined in several ways:
- Add the value directly to the configuration file. This is the most common way.
- Replace the values from environment variables using the
{{}}
notation. This requires infrastructure agent 1.14.0+. For more on this, see more on infrastructure agent passthrough environment variables. - Use secrets management to protect sensible information, such as passwords, so that it's not exposed in plain text on the configuration file. For more information, see secrets management.
Labels and custom attributes
You can also decorate your metrics with labels. Labels allow you to add key/value pair attributes to your metrics so that you can query, filter, or group your metrics.
Even though our default sample configuration file includes examples of labels, they're optional. You can remove, modify, or add new ones.
labels: env: production role: load_balancer
Example configurations
Find and use data
Data from this service is reported to an integration dashboard.
Metrics are attached to the RedisSample
and RedisKeyspaceSample
event types. You can query this data for troubleshooting purposes or to create custom charts and dashboards.
For more on how to find and use your data, see Understand integration data.
Metric data
The Redis integration collects the following metric data attributes:
Redis sample metrics
These attributes are attached to the RedisSample
event type:
Name | Description |
---|---|
| Number of connected slaves. |
| Duration of the last AOF rewrite operation in milliseconds. |
| Boolean representing status of the last AOF background rewrite operation. |
| Boolean representing status of the last AOF write operation. |
| Number of evicted keys due to maxmemory limit per second. |
| Number of key expiration events per second. |
| Number of successful lookups of keys in the main dictionary per second. |
| Number of failed lookup of keys in the main dictionary per second. |
| Duration of the latest fork operation in milliseconds. |
| Boolean. A flag indicating a RDB save is ongoing. |
| Number of changes since the last dump. |
| Boolean representing the status of the last RDB save operation. |
| Duration of the last RDB save operation in milliseconds. |
| Epoch-based timestamp of last successful RDB save in seconds. |
| Count of the number times slaves have fully synchronized with this master. |
| Count of the number of times partial syncs have failed to complete. |
| Count of the number of times partial syncs have completed. |
| Number of clients pending on a blocking call ( |
| The biggest input buffer among current client connections. |
| The longest output list among current client connections. |
| Number of commands processed by the server per second. |
| Number of client connections (excluding connections from slaves). |
| Number of connections accepted by the server per second. |
| Total number of bytes input per second. |
| Total number of bytes output per second. |
| Global number of pub/sub channels with client subscriptions. |
| Global number of pub/sub pattern with client subscriptions. |
| Number of connections per second rejected because of maxclients limit. |
| Number of milliseconds since Redis server start. |
| Ratio between |
| The amount of memory in bytes available in the instance where Redis is running. |
| System CPU consumed by the Redis server in milliseconds. |
| System CPU consumed by the background processes in milliseconds. |
| User CPU consumed by the Redis server in milliseconds. |
| User CPU consumed by the background processes in milliseconds. |
| The total number of bytes allocated by Redis using its allocator (either standard |
| Number of bytes used by the Lua engine. |
| The peak memory consumed by Redis in bytes. |
| Number of bytes that Redis allocated as seen by the operating system (also known as resident set size). This is the number reported by tools such as |
Keyspace metrics
The Redis integration collects the following keyspace metadata and metrics. These attributes are attached to the RedisKeyspaceSample
event type:
Name | Description |
---|---|
| The average time to live (TTL) in milliseconds of keys that have an expiration set in the database being reported on. |
| Number of keys in the database being reported on. |
| Redis database index, which is the integer number (usually a number between |
| Number of keys with an expiration in the database being reported on. |
Inventory data
Inventory data includes everything reported by the Redis CONFIG GET
command, with the exception of requirepass
, which stores the password to the Redis server. For more on inventory data, see Understand inventory data.
Other system data
The Redis integration collects these additional attributes about your Redis service:
Name | Description |
---|---|
| The version of the Redis server. Example: |
| Either |
Check the source code
This integration is open source software. That means you can browse its source code and send improvements, or create your own fork and build it.