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.
-
Log in to the provided Dynatrace environment
-
Click
Deploy Dynatrace
andSet up Serverless integration
-
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 inhandler
- that's why it is referenced asindex.handler
. If the file would be calledlambda.js
and the function would be exported ashello
, the handler function to enter here, would belambda.hello
. -
Enter the values into the AWS console - as provided by the setup screen This will instruct Lambda to first load the Dynatrace agent which instruments and executes the function
-
Click
Save
-
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"
On the deployment screen, click Show deployment status
.
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.
Nevertheless, this PurePath already contains valuable information about the request.
Additionally we get all Node.js metrics that we would get for a regular application.
'Request to public networks' isn't ideal - let's change that.
-
Go to Transactions & services
-
Click on Requests to public networks
-
Click on View requests
-
On the bottom of the page, click on the dynamodb.*.amazonaws.com link
-
Click again to precisize the filter
-
Click on the three dots at the top right of the page
-
Click on Transactions and services again - now the service is shown properly with an icon
-
On the Service detail screen, we can now edit and rename the service to DynamoDB (us-east).
-
Now the Database requests show up properly in the UI
-
Hit the API a few times until the new endpoint shows up
Please consult the Dynatrace documentation for more information.
⬆️ Back to TOC