Build a Distributed Trace in Lambda and Kinesis

Redeploy Lambdas

2 min

Re-deploy your Lambdas

While remaining in your manual directory, run the following commandd to re-deploy your Lambda Functions:

bash
sls deploy -f producer
bash
sls deploy -f consumer

Note that this deployment now only updates the code changes within the function. Our configuration remains the same.

Check the details of your serverless functions:

bash
sls info

You endpoint value should remain the same:

5-redeploy-1-endpoint-value

Send some Traffic again

Use the curl command to send a payload to your producer function. Note the command option -d is followed by your message payload.

Try changing the value of name to your name and telling the Lambda function about your superpower. Replace YOUR_ENDPOINT with the endpoint from your previous step.

bash
curl -d '{ "name": "CHANGE_ME", "superpower": "CHANGE_ME" }' YOUR_ENDPOINT

For example:

bash
curl -d '{ "name": "Kate", "superpower": "Distributed Tracing" }' https://xvq043lj45.execute-api.us-east-1.amazonaws.com/dev/producer

You should see the following output if your message is successful:

json
{"message":"Message placed in the Event Stream: hostname-eventSteam"}

If unsuccessful, you will see:

json
{"message": "Internal server error"}

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

If you see a success message, generate more load: re-send that messate 5+ times. You should keep seeing a success message after each send.

Check the lambda logs output:

bash
sls logs -f producer
bash
sls logs -f consumer

Examine the logs carefully.

Workshop Question

Do you notice the difference?

Note that we are logging our Record together with the Trace context that we have added to it. Copy one of the underlined sub-sections of your trace parent context, and save it for later.

5-redeploy-2-logs

Last Modified ·