Skip to content

TypeError when dd_extension is idle and/or misconfigured #670

Description

@scheuk

Expected Behavior

No error and function works as expected without traces and logs being collected

Actual Behavior

The execution breaks with an stacktrace

Steps to Reproduce the Problem

  1. Configure a lambda function with the datadog tracing
  2. Set DD_API_KEY_SECRET_ARN to an invalid secret
  3. invoke function

Specifications

  • Datadog Lambda Layer version: 82? DD_EXTENSION | DEBUG | Starting Datadog Extension 82
  • Node version: 18

Stacktrace

{
  "stack": "Runtime.UnhandledPromiseRejection: TypeError: Converting circular structure to JSON\n    --> starting at object with constructor 'TLSSocket'\n    |     property '_httpMessage' -> object with constructor 'ClientRequest'\n    --- property 'socket' closes the circle\n    at process.<anonymous> (file:///var/runtime/index.mjs:1329:17)\n    at process.emit (node:events:529:35)\n    at process.emit (node:domain:489:12)\n    at emit (node:internal/process/promises:149:20)\n    at processPromiseRejections (node:internal/process/promises:283:27)\n    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)",
  "message": "TypeError: Converting circular structure to JSON\n    --> starting at object with constructor 'TLSSocket'\n    |     property '_httpMessage' -> object with constructor 'ClientRequest'\n    --- property 'socket' closes the circle",
  "reason": {
      "stack": "TypeError: Converting circular structure to JSON\n    --> starting at object with constructor 'TLSSocket'\n    |     property '_httpMessage' -> object with constructor 'ClientRequest'\n    --- property 'socket' closes the circle\n    at JSON.stringify (<anonymous>)\n    at emitLog (/var/task/node_modules/datadog-lambda-js/dist/utils/log.js:73:20)\n    at logError (/var/task/node_modules/datadog-lambda-js/dist/utils/log.js:48:5)\n    at MetricsListener.<anonymous> (/var/task/node_modules/datadog-lambda-js/dist/metrics/listener.js:310:46)\n    at step (/var/task/node_modules/datadog-lambda-js/dist/metrics/listener.js:56:23)\n    at Object.throw (/var/task/node_modules/datadog-lambda-js/dist/metrics/listener.js:37:53)\n    at rejected (/var/task/node_modules/datadog-lambda-js/dist/metrics/listener.js:29:65)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "message": "Converting circular structure to JSON\n    --> starting at object with constructor 'TLSSocket'\n    |     property '_httpMessage' -> object with constructor 'ClientRequest'\n    --- property 'socket' closes the circle"
  },
  "promise": {}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions