This page describes how to monitor your Cloud Memorystore for Redis instance's performance.Monitoring allows you to check in on your instances to make sure they're behaving as desired. This guide covers a few basic examples of monitoring Redis instances. In addition to the types of monitoring covered here, Cloud Memorystore for Redis is compatible with open source Redis, so you can use existing Redis monitoring tools from Compute Engine VMs to monitor your instances.
Monitoring instances in the Google Cloud Platform Console
To view an instance's core metrics:
- Go to the Cloud Memorystore page in the Google Cloud Platform Console.
- Click the Instance ID of the instance you'd like to view.
You can monitor several metrics by visiting an instance's Instance details page in the Google Cloud Platform Console. By default, the graph shows the instance's current memory usage and its max capacity. Other metrics available in the GCP Console are: evicted keys/expired keys, instance uptime, connected clients/blocked clients, and network bytes in/out.
To change the metrics shown on the graph, use the dropdown in its upper left corner. To change the time frame, select a different period of time in the upper right corner of the graph.
Monitoring instances with Stackdriver
Stackdriver is a free monitoring service that enables you to view metrics such as uptime for your Redis instances. See the Stackdriver documentation for more information.
Signing up for Stackdriver
If you're not using Stackdriver, sign up with your Google Cloud Platform account by navigating to Stackdriver.
- Click Log in with Google.
Select the project that contains your Redis instances and then click Create Account.
Skip the step for installing the Stackdriver agents; they come pre-installed on Cloud Memorystore for Redis instances. Click Continue.
- Click Launch monitoring once the initial collection of data is finished.
- Click Continue with trial to go to your dashboard.
You can put in your payment details later if you want to continue to have access to Stackdriver Premium, but for now you'll get a 30-day trial of the Stackdriver Premium features for free. See the Stackdriver Pricing Page for more information on the differences between the free and premium tiers.
Setup of your Stackdriver account is now complete.
Viewing instance uptime, restart, and failover information in Stackdriver
To view instance uptime information in Stackdriver, go to the Metrics Explorer.
If prompted, log in, then navigate to the project with your Redis instances. Click the button again to be taken directly to Redis's uptime metrics. You can also navigate to the uptime metrics by clicking Resources > Metric Explorer and then selecting
redis_instanceas the resource type and
redis/server/uptimeas the metric.
Your graph looks something like this:
- Each line indicates a single instance.
- Up and to the right indicates Redis is up.
- A drop off indicates a restart.
- Missing data indicates unavailability.
- Below your graph, there's a color-coded key that indicates which line belongs to which instance. As you hover over the key, the corresponding line on the graph is highlighted.
For Standard Tier instances, there will be two entries with the same name but different colors in the key below the graph. The master instance is the line with the highest uptime. You can identify a failover by looking for a spot on the graph where the master instance's line drops off to zero and the replica's line continues to rise, indicating it has become the new master instance.
You can change the time horizon in the upper-right hand corner as well as add filters to tailor the information you're seeing to a particular region, project, instance, or replica.
Viewing operations per second
To view an instance's operations per second in Stackdriver, go to the Metrics Explorer.
If prompted, log in and navigate to the project with your Redis instances. You can then click the link again to be taken directly to the operations per second metric or you can navigate to the metric directly:
Click Resources > Metric Explorer.
- Select Redis instance as the resource type.
- Select Calls as the desired metric.
- Choose Sum from the aggregation drop-down menu.
Calls is a metric surfaced by Cloud Memorystore for Redis that mimics the Redis
instantaneous_ops_per_sec metric when you set the aggregation to sum.
Verifying configuration changes
If you change the configuration of your Redis instance, you can verify that the change has taken place:
View the instance's configuration by going to the Cloud Memorystore page in the GCP Console.
Click the name of the instance, then click Show advanced options to see its configurations.
View the instance's configuration information by entering the
gcloud beta redis instances describe INSTANCE_ID --region=REGION_ID
View all Redis configuration information using the
redis-clitool within your network. Create a Compute Engine VM in the same region, then select a Docker image, such as
After your VM is ready, SSH to it. Then, enter the following command to view Redis configuration information, replacing HOST-IP with the IP address of your Redis instance:
docker run -ti redis /usr/local/bin/redis-cli -h HOST-IP info
You can use
grepto filter the results.
Viewing Redis logs
Redis produces logs that Stackdriver Logging captures.
Viewing audit logs
Go to the Logs Viewer page in the GCP Console.
To view the audit logs, select Audited Resource > redis.googleapis.com from the resources drop-down, as shown below:
Viewing activity logs
Go to the Logs Viewer page in the GCP Console.
To view the activity logs, select Cloud Memorystore Redis instance from the resources drop-down.