probot / adapter-aws-lambda-serverless

An extension for running Probot on Lambda
ISC License
94 stars 36 forks source link

Return helpful response if any required header is missing #65

Open gr2m opened 3 years ago

gr2m commented 3 years ago

follow up to https://github.com/probot/adapter-aws-lambda-serverless/pull/63

/cc @axel3rd I think that would have saved you a lot of headache.

axel3rd commented 3 years ago

Yes 🤯 ^^, but could be part of #60

gr2m commented 3 years ago

yes I agree. I'm just not sure how pointing to https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs.html would be helpful?

Accessing Amazon CloudWatch logs for AWS Lambda - AWS Lambda
AWS Lambda automatically monitors Lambda functions on your behalf, reporting metrics through Amazon CloudWatch. To help you troubleshoot failures in a function, Lambda logs all requests handled by your function and also automatically stores logs generated by your code through Amazon CloudWatch Logs.
axel3rd commented 3 years ago

I'm just not sure how pointing to https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs.html would be helpful?

IMO, the CloudWatch logs is easy to access from Monitoring Tab (and not sure than Lambda Insight can be relevant here).

Using Probot log can do the job (log.debug for input event, log.error in the error catch). And the HTTP content can depend of API integration (for sample I have never viewed a ooops message).

Accessing Amazon CloudWatch logs for AWS Lambda - AWS Lambda
AWS Lambda automatically monitors Lambda functions on your behalf, reporting metrics through Amazon CloudWatch. To help you troubleshoot failures in a function, Lambda logs all requests handled by your function and also automatically stores logs generated by your code through Amazon CloudWatch Logs.
gr2m commented 3 years ago

so in case of an error response, shall we include a JSON key such as

{
  "error": "...",
  "documentation_url": "https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs.html"
}