Monitoring Redis Instances

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:

  1. Go to the Cloud Memorystore page in the Google Cloud Platform Console.
    Cloud Memorystore
  2. 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 monitoring service that lets you to view metrics such as uptime for your Redis instances. For more details about all Cloud Memorystore for Redis metrics available from Stackdriver, see the Stackdriver reference documentation.

Signing up for Stackdriver

If you're not using Stackdriver, sign up with your Google Cloud Platform account by navigating to Stackdriver.

  1. Click Log in with Google.
  2. Select the project that contains your Redis instances and then click Create Workspace.

    image

  3. Skip the step for installing the Stackdriver agents; they come pre-installed on Cloud Memorystore for Redis instances. Click Continue.

  4. Click Launch monitoring once the initial collection of data is finished.

For pricing information, see Stackdriver Pricing.

Setup of your Workspace is now complete.

Viewing instance uptime, restart, and failover information in Stackdriver

  1. To view instance uptime information in Stackdriver, go to the Metrics Explorer.
    Metrics Explorer

  2. 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_instance as the resource type and redis/server/uptime as the metric.

Your graph looks something like this:

Graph of instance uptime

  • 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

  1. To view an instance's operations per second in Stackdriver, go to the Metrics Explorer.
    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:

  2. Click Resources > Metric Explorer.

  3. Select Redis instance as the resource type.
  4. Select Calls as the desired metric.
  5. 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.
    Cloud Memorystore

    Click the name of the instance, then click Show advanced options to see its configurations.

    image

  • View the instance's configuration information by entering the gcloud describe command:

    gcloud redis instances describe INSTANCE_ID --region=REGION_ID

  • View all Redis configuration information using the redis-cli tool within your network. Create a Compute Engine VM in the same region, then select a Docker image, such as gcr.io/containers/busybox:

    image

    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 grep to filter the results.

Viewing Redis logs

Redis produces logs that Stackdriver Logging captures.

Viewing audit logs

  1. Go to the Logs Viewer page in the GCP Console.

    Logs Viewer

  2. To view the audit logs, select Audited Resource > redis.googleapis.com from the resources drop-down, as shown below:

Logs viewer screen shot

Viewing activity logs

  1. Go to the Logs Viewer page in the GCP Console.

    Logs Viewer

  2. To view the activity logs, select Cloud Memorystore Redis instance from the resources drop-down.

Was this page helpful? Let us know how we did:

Send feedback about...

Google Cloud Memorystore for Redis