Hi can anybody suggest how to make the recipient e...
# openobserve
v
Hi can anybody suggest how to make the recipient email id selection dynamic instead of creating a number of separate alerts and destinations, eg. Depending on the type of error you chose to send, we have a table on the db maping error type and email id , also need to know is there any possibility to run SQL queries
s
SQL querying is supported natively in O2
But dynamic recipient resolution from an external DB isn't currently a native email-destination feature. A webhook is the cleanest way to implement the routing without creating hundreds of alerts/destinations.
v
Hi Simran any example, guide or info page regarding this will help us a lot
s
Hi Vijay, sure! Here are the relevant docs: • SQL Alerts: openobserve.ai/docs/…/scheduled-alerts • Alert Destinations & Webhooks: openobserve.ai/docs/…/alert-destinations • Alert Conditions & Filters: openobserve.ai/docs/…/alert-conditions For your use case, you can use a SQL alert to identify the error type and configure a webhook to route the notification to the right recipient based on your DB mapping.The webhook can call your own service, which looks up the email ID and sends the notification. Let me know if you need help setting up the webhook flow.
v
Hi Simran thanks for the quick response, sure i definitely need support , this solution looks like a good suggestion works for us
❤️ 1
Hi Simran, I tried using SQL Alerts and have attached our requirement for reference. We have multiple test benches, and each bench can have multiple subscribed email addresses. These benches generate a large volume of logs, which are monitored through OpenObserve. Whenever an error is detected in the logs of a specific bench, a notification should be sent only to the email recipients subscribed to that particular bench. This ensures that alerts are routed to the appropriate stakeholders responsible for the affected bench. Please let me know if SQL Alerts can support this use case or if there is a recommended approach to achieve it. Thanks, Vijay