Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calls to the STS client to assume a role during Lambda execution silently fail #573

Open
revanshine opened this issue Feb 15, 2024 · 2 comments
Assignees

Comments

@revanshine
Copy link

Expected Behavior

The following Lambda typescript code should work even when the DD instrumentation and layer have been enabled. Variables assumeRoleArn and region are set higher up in the execution.

  console.log("assumeRoleArn 👉", JSON.stringify(assumeRoleArn, null, 2));

  const stsClient = new STSClient({ region: region });
  const stsCommand = new AssumeRoleCommand({
    RoleArn: assumeRoleArn,
    RoleSessionName: "MySession",
  });

  const stsResponse = await stsClient.send(stsCommand);
  console.log(
    `${region} httpStatusCode 👉`,
    stsResponse.$metadata.httpStatusCode
  );

Actual Behavior

This STS code between the two log statements fails without any indication of why. Log level DEBUG doesn't provide any clue either.

Steps to Reproduce the Problem

  1. Configure an IAM role that your Lambda can use to perform hypothetical work, and use code like I've provided above to assume that role during Lambda execution (assuming a role is required for tasks that can be cross-region and/or cross account, but this fails even when performing the work in one region/account).
  2. Test your code without the DD instrumentation to be sure it works as expected. You should see that "httpStatusCode" in your CloudWatch logs.
  3. Add the Datadog construct to your CDK stack and enable it for your Lambda. Set nodeLayerVersion: 106.
    const datadog = new Datadog(this, "Datadog", {
      nodeLayerVersion: 106,
    });
    datadog.addLambdaFunctions([myNodeJsFunction]);
  1. Test your Lambda again, observe that the code never makes it to the log statement for the "httpStatusCode".

Specifications

  • Datadog Lambda Layer version: 106
  • Node version: 18

Trace

{
    "traces": [
        [
            {
                "trace_id": "0018609964b2d951",
                "span_id": "07344b3e124f57f3",
                "parent_id": "d88cc05f2c38f26b",
                "name": "aws.eventbridge",
                "resource": "aws.ec2",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "eventbridge",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.eventbridge",
                    "resource_names": "aws.ec2",
                    "request_id": "fb70545d-5365-4cd6-871e-c2cf99035cd1",
                    "_inferred_span.tag_source": "self",
                    "_inferred_span.synchronicity": "async",
                    "_dd.base_service": "MyStackcd9cf1cd-7woefcctzlja",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955172000000000,
                "duration": 4251793457,
                "service": "eventbridge",
                "type": "web"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "5acbee616e3cd5a7",
                "parent_id": "07344b3e124f57f3",
                "name": "aws.lambda",
                "resource": "MyStackCD9CF1CD-7WOEFCCtzLja",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "MyStackCD9CF1CD-7WOEFCCtzLja",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "function_arn": "arn:aws:lambda:us-east-1:123456789000:function:MyStackcd9cf1cd-7woefcctzlja",
                    "function_version": "$LATEST",
                    "request_id": "fb70545d-5365-4cd6-871e-c2cf99035cd1",
                    "resource_names": "MyStackCD9CF1CD-7WOEFCCtzLja",
                    "functionname": "MyStackcd9cf1cd-7woefcctzlja",
                    "datadog_lambda": "8.106.0",
                    "_dd.parent_source": "xray",
                    "function_trigger.event_source": "eventbridge",
                    "function_trigger.event_source_arn": "aws.ec2",
                    "_dd.base_service": "MyStackcd9cf1cd-7woefcctzlja",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "cold_start": 1,
                    "_dd.measured": 1,
                    "process_id": 8
                },
                "start": 1707955176251793400,
                "duration": 859240234,
                "service": "aws.lambda",
                "type": "serverless"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "5e70395f9b8fd26c",
                "parent_id": "5acbee616e3cd5a7",
                "name": "http.request",
                "resource": "POST",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "MyStackCD9CF1CD-7WOEFCCtzLja",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "component": "http",
                    "span.kind": "client",
                    "http.method": "POST",
                    "http.url": "https://ssm.us-east-1.amazonaws.com/",
                    "out.host": "ssm.us-east-1.amazonaws.com",
                    "http.status_code": "200",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "_dd.measured": 1,
                    "process_id": 8
                },
                "start": 1707955176631687400,
                "duration": 321635986,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja",
                "type": "http"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "0458c6d0a6c8babd",
                "parent_id": "5e70395f9b8fd26c",
                "name": "tcp.connect",
                "resource": "ssm.us-east-1.amazonaws.com:443",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "MyStackCD9CF1CD-7WOEFCCtzLja",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "component": "net",
                    "span.kind": "client",
                    "tcp.remote.host": "ssm.us-east-1.amazonaws.com",
                    "tcp.family": "IPv4",
                    "tcp.local.address": "169.254.76.1",
                    "out.host": "ssm.us-east-1.amazonaws.com",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "_dd.measured": 1,
                    "tcp.remote.port": 443,
                    "tcp.local.port": 44084,
                    "network.destination.port": 443,
                    "process_id": 8
                },
                "start": 1707955176730986800,
                "duration": 120172119,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "582b5f2d7b183ed7",
                "parent_id": "0458c6d0a6c8babd",
                "name": "dns.lookup",
                "resource": "ssm.us-east-1.amazonaws.com",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "MyStackCD9CF1CD-7WOEFCCtzLja",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "component": "dns",
                    "span.kind": "client",
                    "dns.hostname": "ssm.us-east-1.amazonaws.com",
                    "dns.address": "52.46.159.244",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "_dd.measured": 1,
                    "process_id": 8
                },
                "start": 1707955176732153900,
                "duration": 98036133,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "381372d71989d116",
                "parent_id": "07344b3e124f57f3",
                "name": "aws.lambda.load",
                "resource": "MyStackCD9CF1CD-7WOEFCCtzLja",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require",
                    "resource_names": "MyStackCD9CF1CD-7WOEFCCtzLja",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175564000000,
                "duration": 646000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "37e40586acaaf837",
                "parent_id": "381372d71989d116",
                "name": "aws.lambda.require_layer",
                "resource": "./lambda",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "./lambda",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/lambda/index.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175565000000,
                "duration": 8000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "35138ad632164803",
                "parent_id": "37e40586acaaf837",
                "name": "aws.lambda.require_layer",
                "resource": "./runtime/ritm",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "./runtime/ritm",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/lambda/runtime/ritm.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175566000000,
                "duration": 6000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "066e35bc003a6011",
                "parent_id": "381372d71989d116",
                "name": "aws.lambda.require_layer",
                "resource": "../../datadog-plugin-fetch/src",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "../../datadog-plugin-fetch/src",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/datadog-plugin-fetch/src/index.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175573000000,
                "duration": 8000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "427bd638b75f2bb3",
                "parent_id": "066e35bc003a6011",
                "name": "aws.lambda.require_layer",
                "resource": "../../datadog-plugin-http/src/client",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "../../datadog-plugin-http/src/client",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/datadog-plugin-http/src/client.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175574000000,
                "duration": 7000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "5e460d07bc02958f",
                "parent_id": "427bd638b75f2bb3",
                "name": "aws.lambda.require_layer",
                "resource": "../../dd-trace/src/plugins/client",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "../../dd-trace/src/plugins/client",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/plugins/client.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175575000000,
                "duration": 5000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "30d2a0a19708f812",
                "parent_id": "5e460d07bc02958f",
                "name": "aws.lambda.require_layer",
                "resource": "./outbound",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "./outbound",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/plugins/outbound.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175576000000,
                "duration": 4000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "30cbd3964ba13b23",
                "parent_id": "30d2a0a19708f812",
                "name": "aws.lambda.require_layer",
                "resource": "./tracing",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "./tracing",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/plugins/tracing.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175577000000,
                "duration": 3000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "484aea81864868c8",
                "parent_id": "381372d71989d116",
                "name": "aws.lambda.require_layer",
                "resource": "./appsec/remote_config",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "./appsec/remote_config",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/appsec/remote_config/index.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175582000000,
                "duration": 5000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "65bb591d7a75559a",
                "parent_id": "484aea81864868c8",
                "name": "aws.lambda.require_layer",
                "resource": "./manager",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "./manager",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/appsec/remote_config/manager.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175583000000,
                "duration": 3000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "7d38ebfb91248a91",
                "parent_id": "381372d71989d116",
                "name": "aws.lambda.require_layer",
                "resource": "./appsec/sdk",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "./appsec/sdk",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/appsec/sdk/index.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175587000000,
                "duration": 7000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "5787c45fc1b9a38f",
                "parent_id": "7d38ebfb91248a91",
                "name": "aws.lambda.require_layer",
                "resource": "./user_blocking",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "./user_blocking",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/appsec/sdk/user_blocking.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175589000000,
                "duration": 5000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "2206e4fbbaa44256",
                "parent_id": "5787c45fc1b9a38f",
                "name": "aws.lambda.require_layer",
                "resource": "../blocking",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "../blocking",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/appsec/blocking.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175591000000,
                "duration": 3000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "0ecd692c865c073d",
                "parent_id": "381372d71989d116",
                "name": "aws.lambda.require",
                "resource": "/var/task/index.js",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require",
                    "resource_names": "/var/task/index.js",
                    "filename": "/var/task/index.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175605000000,
                "duration": 526000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "014df0a424adea7a",
                "parent_id": "0ecd692c865c073d",
                "name": "aws.lambda.require_layer",
                "resource": "../http",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "../http",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/datadog-instrumentations/src/http.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175943000000,
                "duration": 4000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "5988510604fe9915",
                "parent_id": "0ecd692c865c073d",
                "name": "aws.lambda.require_layer",
                "resource": "../../../datadog-plugin-http/src",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "../../../datadog-plugin-http/src",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/datadog-plugin-http/src/index.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175947000000,
                "duration": 26000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "474abbb6692b654a",
                "parent_id": "5988510604fe9915",
                "name": "aws.lambda.require_layer",
                "resource": "./server",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "./server",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/datadog-plugin-http/src/server.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175948000000,
                "duration": 25000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "43cd055710e3663a",
                "parent_id": "474abbb6692b654a",
                "name": "aws.lambda.require_layer",
                "resource": "../../dd-trace/src/plugins/util/web",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "../../dd-trace/src/plugins/util/web",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/plugins/util/web.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175952000000,
                "duration": 18000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "470ef7c95eb9fb3b",
                "parent_id": "43cd055710e3663a",
                "name": "aws.lambda.require_layer",
                "resource": "./ip_extractor",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "./ip_extractor",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/plugins/util/ip_extractor.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175955000000,
                "duration": 15000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "5068299b0a750506",
                "parent_id": "470ef7c95eb9fb3b",
                "name": "aws.lambda.require_layer",
                "resource": "./ip_blocklist",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "./ip_blocklist",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/plugins/util/ip_blocklist.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175955000000,
                "duration": 13000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "45f32c70653f86f8",
                "parent_id": "5068299b0a750506",
                "name": "aws.lambda.require_layer",
                "resource": "../../../datadog-plugin-dns/src",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "../../../datadog-plugin-dns/src",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/datadog-plugin-dns/src/index.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955175963000000,
                "duration": 3000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            },
            {
                "trace_id": "0018609964b2d951",
                "span_id": "5ebb3d87096eecff",
                "parent_id": "381372d71989d116",
                "name": "aws.lambda.require_layer",
                "resource": "./patch",
                "error": 0,
                "meta": {
                    "_dd.origin": "lambda",
                    "service": "aws.lambda",
                    "runtime-id": "2e2b95cc-bec3-4db8-8b69-eaca2d896adc",
                    "operation_name": "aws.lambda.require_layer",
                    "resource_names": "./patch",
                    "filename": "/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/lambda/runtime/patch.js",
                    "language": "javascript",
                    "_sampling_priority_v1": "2"
                },
                "metrics": {
                    "process_id": 8
                },
                "start": 1707955176131000000,
                "duration": 3000000,
                "service": "MyStackCD9CF1CD-7WOEFCCtzLja"
            }
        ]
    ]
}
@zARODz11z
Copy link
Contributor

Hi @revanshine, I attempted to reproduce but was unsuccessful, I followed this video to configure the role, may you try following that and see if it resolves your issues?

@revanshine
Copy link
Author

Our code works fine without the DD instrumentation.

@purple4reina purple4reina transferred this issue from DataDog/datadog-cdk-constructs Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants