Distributed Tracing for AWS Lambda Functions

Deploying Lambda Functions & Generating Trace Data

3 min

Now that we know how to apply manual instrumentation to the functions and services we wish to capture trace data for, let’s go about deploying our Lambda functions again, and generating traffic against our producer-lambda endpoint.

Initialize Terraform in the manual directory

Seeing as we’re in a new directory, we will need to initialize Terraform here once again.

Deploy the Lambda functions and other AWS resources

Let’s go ahead and deploy those resources again as well!

As you can tell, aside from the first portion of the base_url and the log gropu ARNs, the output should be largely the same as when you ran the auto-instrumentation portion of this workshop up to this same point.

Send some traffic to the producer-lambda endpoint (base_url)

Once more, we will send our name and superpower as a message to our endpoint. This will then be added to a record in our Kinesis Stream, along with our trace context.

Info

If this occurs, ask one of the workshop facilitators for assistance.

View the Lambda Function Logs

Let’s see what our logs look like now.

Examine the logs carefully.

Workshop Question

Do you notice the difference?

Copy the Trace ID from the consumer.logs file

This time around, we can see that the consumer-lambda log group is logging our message as a record together with the tracecontext that we propagated.

To copy the Trace ID:

Lambda Consumer Logs, Manual Instruamentation

Last Modified ·