Hi we had a situation where we configured signoz a...
# support
a
Hi we had a situation where we configured signoz alert channel with aws lambda function. we are getting emails when triggering via api or on browser . but when configured the same url in the signoz alert channels . we are not getting the email. This email is to be sent when api takes more than 200 ms
a
hey @Anil Kumar Bandrapalli your setup sounds awesome. Are you triggering lambada through a webhook call? Would you like to share your lambada function code with the community. I think others can really benefit from it.
a
@Amol Umbark , still right now i am sending emails with static content in the mail
once if i am able to give some dynamic content then i will share the info with you guys
a
that will be great. thanks
a
Steps to create Lambda function 1. Once you are able to generate the mails by running your code, then create a folder called nodejs and copy the node_modules folder into it. 2. Now zip the nodejs folder. 3. Now goto your aws lambda and create a Layer from the left-side navigation. 4. upload the zip file which you created. 5. Once saved, goto F*unctions* and click on create function . 6. Select Author from scratch option and give some relevant name to your function. 7. Select the runtime as Node Js version X (Select the version you wanted, like 14.x or 16.x). 8. Click on Advanced settings and check Enable function URL (which generates an auto url to trigger the function) and Select the Auth type you prefer. 9. Now click on create function button to create a new lambda function. 10. Now in the list of Lambda functions , choose your function and scroll down to Layers section 11. Click on Add a Layer -> Custom Layers 12. Choose the Layer which you created earlier and Click on Add 13. Now copy your code from your machine and paste it in index.js file between exports.handler = async (event) => { } 14. Now create a package.json file and copy the content from your local machine to this file. 15. Now click on Test and configure a simple test and run it. 16. Now the recipient will receive the mail. 17. In the Function overview, Copy the Function URL and paste it in your browser. That URL will trigger Lambda function.