Instrument Lambda Functions

  1. Navigate to AWS Lambda and take a moment to understand the functions in this app. There are 4 of them: 'watchlistUpdater', 'stockRanker', 'getFinancials', and 'buyStocks'. The architecture of these functions will become clear once you instrument them for APM.
  2. Navigate to the Splunk O11y 'Data Setup' page, and search for lambda (you may have to click Extend search across all integrations). Select AWS Lambda (Serverless instrumentation), and click Add Integration.
  3. For 'Function name', enter the name of the first Lambda function you will instrument (e.g. watchlistUpdater). Select your Splunk access token (make sure it has the right permissions for APM), and enter a name for this app's environment (e.g. lambda-app). Click 'Next'. Make sure the environment name is the same for all your functions in this app.
  4. On the 'Install Integration' page, select Python. Follow the steps on this page to add the Splunk OTel layer and set the environment variables. For the ARN, use arn:aws:lambda:us-east-1:254067382080:layer:splunk-apm:54.
  5. Phew! That was a lot. Now repeat Step 11 for all 4 Lambda functions. (You do not need to go through the Splunk O11y GDI wizard again; simply make the changes necessary in AWS.)

Last update: August 11, 2022