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

Record the unique Id for the lambda call when we create new objects in Unee-T #3

Open
franck-boullier opened this issue Aug 20, 2019 · 1 comment
Assignees

Comments

@franck-boullier
Copy link
Member

The problem:

How can we easily check if a lambda call was done successfully?
Today all the info is stored in 3 tables

  • ``
  • ``
  • ``
    BUT we do NOT have the unique ID for the lambda call that was made, making it difficult to automatically check if a lambda call was successful when done end to end.

We need to alter the DB schema to fix this issue.

@franck-boullier franck-boullier self-assigned this Aug 20, 2019
@kaihendry
Copy link

kaihendry commented Aug 20, 2019

Currently when a payload from UNTE comes into https://github.com/unee-t/lambda2sns it logs into the CloudWatch log group alambda_simple, the mefeAPIRequestId so that it can be queried.

Try it at https://logs.dev.unee-t.com/ or via the CloudWatch console.

Logs containing mefeAPIRequestId also show the requestID which is the UUID created by AWS to uniquely identify the lambda run.

There is added complexity in https://github.com/unee-t/lambda2sns/blob/master/main.go#L180 to try and relay the outcome of the payload from MEFE to the database. This is accomplished by calling a stored procedure which IIUC populates the 3 tables mentioned above.

This is done because mysql.lambda_async having no way to respond & to avoid looking directly at the logs.
Unfortunately this is error prone if the database is unavailable or if the lambda was somehow terminated. In an ideal world, the microservice or API responsible for changing the state due to the payload instruction could notify what initiated the state change request directly, without lambda2sns getting involved. Or at least have an easy API for the initiator to check the payload has been carried out.

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

2 participants