Skip to content

_signalLambdaEnd request to Lambda extension should set Content-Type #3858

Open
@trentm

Description

@trentm

In a user support request it was noted that they saw this error in the Node.js APM agent logs running in a Lambda:

{ "log.level": "error", "@timestamp": "2024-01-17T20:54:32.917Z", "log.logger": "elastic-apm-node", "ecs.version": "8.10.0", "event.module": "apmclient", "durationMs": 53.83446400007233, 
  "err": "unexpected response status code: 400", 
  "message": "_signalLambdaEnd error" }

and the matching APM server logs included:

{
    "http.request.body.bytes": 0,
        "image": "docker.elastic.co/cloud-assets/apm:7.17.10-0",
    "http.request.method": "POST",
    "log.level": "error",
    "http.response.status_code": 400,
    "user_agent.original": "apm-agent-nodejs/3.50.0 ...",
    "service.name": "apm-server",
    "message": "data validation error",
    "url.original": "/intake/v2/events?flushed=true",
    "error.message": "invalid content type: ''",
    // ...
}

(Side note: This seems to be a misconfigured Lambda that has the APM agent talking directly to APM server, instead of via the Elastic Lambda extension. IOW, this log.error is likely to be very rare.)

In any case, adding a Content-Type: application/json, even though the request is empty should avoid this rare error log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-nodejsMake available for APM Agents project planning.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions