tamirble
tamirble

Reputation: 61

Debugging Datadog monitoring integration with AWS lambda

My purpose is to monitor (APM, Logs) all our aws-lambda functions with Datadog.

I've set the Datadog AWS integration with manual creation of role and policy and it looks like working, I see AWS the metrics.

Now I want to add APM to our Lambda functions, but when I try to set up the APM integration with AWS CDK, I see nothing on APM.

This is the integration code:

export class MyStack extends Stack {
    constructor(scope: Construct, id: string, props?: BigHeadStackProps) {
        super(scope, id, props);

    const TheMonitoredFunction: Function = this.createLambdaFunction(props);

    const datadog: Datadog = new Datadog(this, "Datadog", {
        pythonLayerVersion: 60,
        extensionLayerVersion: 25,
        site: "datadoghq.eu",
        captureLambdaPayload: true,
        apiKeySecretArn: "SECRET"
    });
    
    datadog.addLambdaFunctions([TheMonitoredFunction]);

Am I doing something wrong above? If not, how can I debug this integration?

Upvotes: 1

Views: 658

Answers (1)

tamirble
tamirble

Reputation: 61

As I was instructed by the Datadog team, the right thing to do here is to check whether the layers created under the lambda function. In my case they were not created due to a deployment issue.

In case layers are created they suggested to add a debug flag to the deployment logLevel: "debug" and look for errors. After deploying it right, everything works - both apm and logs.

Upvotes: 0

Related Questions