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

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

Open
trentm opened this issue Feb 1, 2024 · 0 comments
Open

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

trentm opened this issue Feb 1, 2024 · 0 comments
Labels
agent-nodejs Make available for APM Agents project planning.

Comments

@trentm
Copy link
Member

trentm commented Feb 1, 2024

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.

@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

No branches or pull requests

1 participant