Auto-Tracing for AWS Lambda Calls to Redis Databases

Maurice Rickard
IOpipe Blog
Published in
3 min readOct 1, 2019

--

One of the biggest challenges for developers building on AWS Lambda is gaining whole event observability — particularly when it pertains to functions that make calls outside of the AWS ecosystem.

Named the most loved database in Stack Overflow’s 2019 Developer Survey, Redis tracing has been a consistently popular feature request for IOpipe and AWS Lambda users.

We appreciate our user feedback, which made it an easy decision to add to one of our summer engineering sprints. Without further ado, if you’re making AWS Lambda calls to a Redis database, we’ve rolled out automatic tracing for Redis commands, using either redis or ioredis node modules.

The new feature allows users to trace any Redis command automatically and provide real-time invocation metrics including name of command, which key is being read or written, how long the command took to execute, and information about the connection: hostname, port, and connection name (if defined in your connection options).

Get started tracing Redis commands

To get started, sign-up for your free IOpipe account or trial and choose your quickstart install method.

To trace redis (node_redis) commands, set the environment variable `IOPIPE_TRACE_REDIS` to `true`. (If you’re using redis@2.5.3 or earlier, turn on auto-tracing with the `IOPIPE_TRACE_REDIS_CB` environment variable set to true.)

To trace ioredis, set the environment variable `IOPIPE_TRACE_IOREDIS` to `true`.

Once you’ve turned on auto-tracing and redeployed your function, you should start seeing traces in your IOpipe dashboard. Find your function invocation, and click the Tracing tab to see traces.

Note that depending on how your function is programmed, database operations may generate different numbers of traces at different times.

Trace and metric interface on first load:

Tracing/metric interface with Tracing selected:

In collapsed form, each trace shows the connection name, server, port, and, in brackets, database index. The middle columns show the command and the key (if any) targeted by the command, as well as the invocation duration, and its percentage of the overall duration.

Clicking any one of these traces will expand it to show more data:

If you have any questions, please join our Community Slack or email support@iopipe.com. We love any user feedback.

About IOpipe

As the leader in serverless dev tooling for monitoring and observability, IOpipe offers real-time visibility into the most granular behaviors of today’s serverless applications on AWS Lambda.

Founded in 2016 by Erica Windisch and Adam Johnson, IOpipe reduces debugging time from hours to seconds, delivers transparent insights into the behaviors and performance of your serverless functions, and reduces risk for enterprises shifting to serverless.

Working with global brands like Matson, Rackspace, and APM Music, IOpipe empowers engineering teams to deliver with confidence, debug intelligently, and get busy building the impossible.

In other words, IOpipe makes it a lot more fun to be a developer. Visit www.iopipe.com to learn more and try it for free.

--

--