How to retrieve logs from Memorystore for Redis instance in GCP

3.1k views Asked by At

I had a connection incident with my Memorystore for Redis instance last night saying Redis server went away and I would like to retrieve the logs to see what actually happened since Monitoring didn't provide much insight. It appears that this is harder than I expected.

There's no option for Memorystore in Cloud Logging to retrieve the logs - I've been searching through the documentation and SO for an answer for a few hours now and haven't found one. All I found is this doc that briefly mentions Redis produces logs that Cloud Logging captures. - that's it.

I've even set up Audit Logging, enabling all options for Memorystore but it's just showing Access Logs and such, not the actual logs created by Redis, just as I feared. What am I missing here? Surely it can't be that cumbersome to retrieve the logs from Memorystore... If I'm on the wrong path and that's not how it's done then how can I achieve it? Am I supposed to connect to Redis from GCE as mentioned here and get the logs from there? I'm really confused, any help would be appreciated, thank you in advance.

1

There are 1 answers

0
Daniel Ocando On

Since Cloud Memorystore for Redis is a managed service you won't be able to check the logs in a similar fashion as to what is explained in other posts of the community (such as this one), by checking the logs on the server hosting the redis instance, as you are bound by the following product constraints. This is the tradeoff of using such managed services. If you'd require more control on that side of your application you could host your instance on a Compute Engine VM, where you could have complete control of the Redis server. If you'd prefer to keep the managed service you'll need to concentrate your efforts on implementing more descriptive client side logs to find if any expensive command have been run during the times where you experience such issues.

If your Redis instance was created after November 4th, 2019, you could connect to the instance using the documentation you mention and run the MONITOR command to check every command processed by the Redis server (although notice that running this command will have an impact on the performance of the instance, as it can reduce the throughput by more than 50%).

If you can't find an explanation on the troubleshooting section of the documentation, the issue could be associated with an issue on Google's resources associated with your instance and you should contact Google Cloud Support.