Skip to content

Latest commit

 

History

History

lab4

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Lab 4: Monitoring a Lambda Function with Dynatrace

So far we have deployed the agent, but we have to add a bit more configuration to load it with our Lambda function.

While Lambda monitoring is still in Early Access, the provided Dynatrace Environments already have it enabled.

Step-by-step Guide

  1. Log in to the provided Dynatrace environment

  2. Click Deploy Dynatrace and Set up Serverless integration

    Lambda Deployment

  3. On the following screen select Node.js and leave the defaults.

    Our function is stored in the file index.js and the code is exporter in handler- that's why it is referenced as index.handler. If the file would be called lambda.js and the function would be exported as hello, the handler function to enter here, would be lambda.hello.

    Lambda Deployment

  4. Enter the values into the AWS console - as provided by the setup screen Lambda Deployment This will instruct Lambda to first load the Dynatrace agent which instruments and executes the function

  5. Click Save

  6. Let's use Postman to hit the Lambda function a few times. Also do some POST requests. For that, use this document as the DynamoDB client you install via module expects a slightly different format.

    "Item": {
      "titleId": "A_Kind_of_Magic_1986",
      "AlbumTitle": "A Kind of Magic",
      "Artist": "Queen",
      "SongTitle": "A Kind of Magic",
      "Year": "1986"
    },
    "ReturnConsumedCapacity": "TOTAL",
    "TableName": "Music"

Explore the Monitoring Data in Dynatrace

On the deployment screen, click Show deployment status. Lambda Dynatrace

When we navigate to the PurePath view, we see that the DynamoDB call is identified as a call to public networks, which might be missleading.

Lambda Dynatrace

Nevertheless, this PurePath already contains valuable information about the request.

Lambda Dynatrace

Additionally we get all Node.js metrics that we would get for a regular application.

Excursus

'Request to public networks' isn't ideal - let's change that.

  1. Go to Transactions & services

  2. Click on Requests to public networks

  3. Click on View requests

  4. On the bottom of the page, click on the dynamodb.*.amazonaws.com link

  5. Click again to precisize the filter

  6. Click on the three dots at the top right of the page

  7. Select 'Monitor as separate service' Lambda Dynatrace

  8. Click on Transactions and services again - now the service is shown properly with an icon

  9. On the Service detail screen, we can now edit and rename the service to DynamoDB (us-east).

    Lambda Dynatrace

  10. Now the Database requests show up properly in the UI

    Lambda Dynatrace

  11. Hit the API a few times until the new endpoint shows up

Please consult the Dynatrace documentation for more information.

⬆️ Back to TOC