|
| 1 | +# Alert Destinations |
| 2 | +In OpenObserve, **Alert Destinations** enables users to set up notification channels for alert messages. These destinations define where and how notifications will be delivered when alerts are triggered. Alert destinations are reusable, allowing them to be associated with multiple alerts for efficient management. |
| 3 | + |
| 4 | +The **Alert Destinations** section provides three configuration options: |
| 5 | + |
| 6 | +1. **Webhook**: Sends a JSON payload to a specified HTTP endpoint such as Slack webhook URL. |
| 7 | +2. **Email**: Sends a formatted email to predefined recipients. |
| 8 | +2. **Actions**: Executes a custom Python script packaged and uploaded by the user. |
| 9 | + |
| 10 | +Below is a detailed guide on how to configure alert destinations in OpenObserve. |
| 11 | + |
| 12 | +## Configure Webhook Destinations |
| 13 | + |
| 14 | +Webhooks are ideal for integrating OpenObserve alerts with third-party platforms, such as Slack, Microsoft Teams, or custom systems. Follow these steps to configure a Webhook destination: |
| 15 | + |
| 16 | +1. In OpenObserve, go to **Management** from the top navigation bar. |
| 17 | +2. Select **Alert Destinations**. |
| 18 | +3. Select the **Webhook** tab. |
| 19 | +4. Fill in the following details: |
| 20 | + |
| 21 | + - **Name**: Enter a descriptive name for the Webhook destination such as **SlackNotifications**. |
| 22 | + > Note: Characters like :, ?, /, #, and spaces are not allowed. |
| 23 | + - **Template**: Choose a alert message template from the dropdown menu. Refer to [Templates](templates.md) to create or manage templates. |
| 24 | + - **URL**: Specify the Webhook endpoint URL where notifications will be sent. |
| 25 | + - **Method**: Select the HTTP method depending on the Webhook's requirements. |
| 26 | + - **Output Format**: Choose **JSON** unless the receiving system explicitly requires **NDJSON** format. |
| 27 | + > Why Output Format Matters <br> |
| 28 | + > You define where the alert should be sent — this is the alert destination. <br> |
| 29 | + > OpenObserve sends the alert to that destination — which is a remote server. <br> |
| 30 | + > The remote server expects the payload in a specific format. <br> |
| 31 | + > You choose JSON or NDJSON accordingly. <br> |
| 32 | + > **Example:** <br> |
| 33 | + > **If the destination is a Slack webhook, choose JSON.** <br> |
| 34 | + > **If the destination is another OpenObserve instance, choose JSON.** <br> |
| 35 | + > **If the destination is a Splunk HTTP Event Collector (HEC) endpoint, choose NDJSON.** <br> |
| 36 | + > |
| 37 | + - **Headers (Optional)**: Add custom headers in key-value format such as authentication tokens or content type. |
| 38 | + - **Skip TLS Verify**: Enable this option if the endpoint uses self-signed certificates or if you want to bypass SSL verification. |
| 39 | +6. Click **Save** to create the Webhook destination. |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +### Example |
| 44 | + |
| 45 | +- **Name**: Slack Alerts |
| 46 | +- **Template**: SlackTemplate |
| 47 | +- **URL**: `https://hooks.slack.com/services/T02QBH105PF/B04C7NLLLRE/HY3fXf123` |
| 48 | +- **Method**: POST |
| 49 | +- **Output Format**: JSON |
| 50 | +- **Headers**: |
| 51 | + - **Key**: Authorization |
| 52 | + - **Value**: Basic cm9vdEBleGFtcGxlLmNvbTpDb21wbGV4GFzcy |
| 53 | + |
| 54 | + |
| 55 | +## Configure Email Destinations |
| 56 | + |
| 57 | +Email destinations are used for delivering alert notifications directly to specified email addresses. To configure an Email destination: |
| 58 | + |
| 59 | +1. In OpenObserve, go to **Management** from the top navigation bar. |
| 60 | +2. Select **Alert Destinations**. |
| 61 | +3. Select the **Email** tab. |
| 62 | +4. Fill in the following details: |
| 63 | + - **Name**: Provide a descriptive name for the Email destination (e.g., "Team Alerts"). |
| 64 | + - **Template**: Select a predefined email message template from the dropdown. |
| 65 | + - **Recipients**: Enter one or more email addresses, separated by commas or semicolons. |
| 66 | +5. Click **Save** to create the Email destination. |
| 67 | + |
| 68 | + |
| 69 | +### Example |
| 70 | + |
| 71 | +- **Name**: Critical Alerts |
| 72 | +- **Template**: EmailTemplate |
| 73 | + |
| 74 | + |
| 75 | +## Additional Notes |
| 76 | + |
| 77 | +- Configured destinations appear in the **Destinations** list under the **Alerts** module. From this list, you can: |
| 78 | + - Search for specific destinations by name or type. |
| 79 | + - Edit existing destinations to update settings. |
| 80 | + - Delete destinations that are no longer required. |
| 81 | +- Destinations can be linked to multiple alerts, allowing for efficient and consistent notification management. |
| 82 | + |
| 83 | +By following this guide, you can set up Webhook and Email destinations to ensure timely and reliable alert notifications in OpenObserve. |
| 84 | + |
| 85 | + |
| 86 | +### Setup and Configure OpenObserve to Send Email Alerts via SMTP |
| 87 | + |
| 88 | +To send email alerts, OpenObserve requires SMTP configuration. This can be done by setting the appropriate environment variables when starting OpenObserve. |
| 89 | + |
| 90 | + |
| 91 | +#### Start OpenObserve with SMTP Configuration |
| 92 | + |
| 93 | +Use the following command to configure OpenObserve to send email alerts via Gmail: |
| 94 | + |
| 95 | +```bash |
| 96 | +ZO_SMTP_ENABLED=true \ |
| 97 | +ZO_SMTP_HOST="smtp.gmail.com" \ |
| 98 | +ZO_SMTP_PORT=587 \ |
| 99 | +ZO_SMTP_USER_NAME="your-user-name" \ |
| 100 | +ZO_SMTP_PASSWORD="your-app-password" \ |
| 101 | +ZO_SMTP_FROM_EMAIL="your-email-address" \ |
| 102 | +ZO_SMTP_ENCRYPTION="starttls" \ |
| 103 | +ZO_ROOT_USER_EMAIL= "[email protected]" \ |
| 104 | +ZO_ROOT_USER_PASSWORD="Complexpass#123" \ |
| 105 | +./openobserve |
| 106 | +``` |
| 107 | +Replace the placeholders (your-email-address, your-app-password, etc.) with your actual SMTP details. |
| 108 | + |
| 109 | +By configuring SMTP, you ensure that OpenObserve can send reliable email notifications for your alerts. |
| 110 | + |
| 111 | +If you're interested in learning more about SMTP environment variables, refer to this documentation: [SMTP Environment Variables](https://openobserve.ai/docs/environment-variables/#smtp). |
| 112 | + |
| 113 | +For step-by-step instructions on setting up Email Alerts in OpenObserve, check out our Blog: [How to Configure Email Alerts in OpenObserve](https://openobserve.ai/blog/how-to-configure-email-alerts-in-openobserve). |
| 114 | + |
0 commit comments