Komiser supports webhooks at the views level to incentivize developers on cost and cloud usage and bring accountability to cloud spending. Users can set up personalized notifications to proactively monitor their multi-cloud resources, ensuring timely awareness of important events and potential issues. These alerts can be configured based on various criteria such as custom views, resource costs, and resource usage.

Developers can create custom views and set up alerts to monitor resource costs and usage without spending all day monitoring the views. With Komiser, users can set up alerts via Slack or provide Custom Webhooks to trigger certain actions such as -Creating a Ticket: Creating a ticket on Jira/Linear to be tackled by the infrastructure team. -Insident Alert: Triggering an alert on an incident & response platform like PagerDuty. -Custom Script Execution: Running a custom script to resize the infrastructure.

Note: The above actions are just a few examples of the endless possibilities that can be set by the user on the webhook receiving end. Komiser sends the required data in a pre-defined format. Alerts are triggered every hour in Komiser.

Steps to add an Alert

  1. Head over to the view you want to set an alert for.
  2. Click on Alerts on the top right of the screen.
  3. Click on Add an Alert.
  4. Choose the alert method: Slack/Custom Webhook. If you want to add Slack and it is disabled, refer to the Slack Integration section below.
  5. Fill in the details accordingly.
  6. Save the alert.
  7. Congratulations! You should now see the alert when you click on the alerts tab again.
This is the expected output of a triggered alerts on Slack

Slack integration

To integrate Komiser with Slack you will have to generate a webhook and add it to the config.toml file. Find the steps to generate the slack webhook in the official slack documentation here.

Steps to integrate Komiser with Slack:

  1. Create a Slack app (if you don’t have one already).
  2. Enable Incoming Webhooks.
  3. Create an Incoming Webhook.
  4. Pick a channel that the app will post to, and then click to Authorize your app.
  5. You’ll be sent back to your app settings, and you should now see a new entry under the Webhook URLs for Your Workspace section, with a Webhook URL that’ll look something like this:
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
  1. Then simply add the [slack] block to your config.toml file:
[slack]
webhook="https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"

Custom Webhook integration

To integrate a custom webhook, you need a URL that listens to the data posted to it when it is triggered. You don’t need to edit the config.toml file for this integration.

Request Details

Komiser makes a POST request to the endpoint. The data is sent in the following format in the request body:

{
    "komiser": "<komiser-version>", // [string]
    "view": "<view-name>", // [string]
    "message": "Usage/Cost alert", // [string]
    "data": 32, // [float64] the threshold set for the alert
    "timestamp": 1685793973 // [int64] number of seconds since January 1, 1970 UTC
}

You can add an optional Secret field. It is a secret value that is added as a request header: authorization: <secret>. It is recommended to test the endpoint before submitting the alert and verify the data you receive is the same as:

{
    "komiser": "komiser version that will send the webhook",
    "view": "testing the connection",
    "message": "test alert",
    "data": 0,
    "timestamp": 1685794020 // number of seconds since January 1, 1970 UTC when you test the endpoint hence will be different for you
}
Webhook alert configuration screen

Komiser Alerts Webhook Integration Use Cases

In this guide, we’ll explore five practical use cases for the Komiser alerts webhook integration. This integration allows you to trigger actions based on alerts generated by Komiser, helping you proactively manage your cloud resources. We’ll also reference the Komiser Alerts documentation to demonstrate how to set up these use cases.

Use Case 1: Send Email Alerts to Admin

Scenario: When Komiser alerts trigger, you want to notify your admin team via email and create a ticket in a task management system.

Solution:

  1. Komiser Alert Configuration: Follow the steps outlined in the Komiser Alerts to set up alerts for cost or usage thresholds.
  2. Webhook Integration: Configure a webhook integration in Komiser to send alerts.
  3. Zapier Integration: Use Zapier to connect the Komiser webhook to your email service and task management system. Create a Zap that triggers an email to the admin and generates a ticket on Linear.

Use Case 2: Automate AWS Lambda Actions

Scenario: When Komiser alerts are triggered, you want to automatically execute actions in AWS Lambda.

Solution:

  1. Komiser Alert Configuration: Set up alerts as per the Komiser Alerts.
  2. Webhook Integration: Configure a webhook in Komiser to send alerts.
  3. AWS Lambda Integration: Create an AWS Lambda function that is triggered by the Komiser webhook. Define the actions you want Lambda to take when an alert is received.

Use Case 3: PagerDuty Incident Alert

Scenario: Komiser alerts should trigger PagerDuty incidents, and you want to create post-mortem documentation.

Solution:

  1. Komiser Alert Configuration: Set up alerts as described in the Komiser Alerts.
  2. Webhook Integration: Configure a webhook integration in Komiser to send alerts.
  3. PagerDuty Integration: In PagerDuty, set up a service that listens for alerts from Komiser via the webhook. Configure PagerDuty to trigger incidents.
  4. Notion Documentation: Use Zapier or another integration to automatically create post-mortem documentation in Notion when an incident is triggered in PagerDuty.

Use Case 4: Slack Channel Notifications

Scenario: Receive Komiser alerts in a Slack channel for real-time monitoring.

Solution:

  1. Komiser Alert Configuration: Follow the Komiser Alerts to set up alerts.
  2. Slack Integration: Configure the Komiser webhook integration to send alerts to a Slack channel. Reference the Slack Integration section for guidance.

Use Case 5: Custom Script Execution

Scenario: Trigger a custom script when specific Komiser alerts are received.

Solution:

  1. Komiser Alert Configuration: Configure Komiser alerts according to your requirements.
  2. Webhook Integration: Set up a webhook integration in Komiser to send alerts.
  3. Custom Script: Develop a custom script that listens for alerts from Komiser via the webhook. Define the actions you want the script to perform based on the alert content.

By following these use cases, you can make the most of Komiser’s alert webhook integration to automate actions, streamline communication, and enhance your cloud resource management. For detailed setup instructions and webhook configuration, refer to the Komiser Alerts documentation.