Integration guide for alert notifications

We offer custom integration for the following alert sources

Introduction to notification Integrations

This guide enables developers to leverage webhooks for integrating custom events and alerts into their applications, enhancing incident management capabilities.

Key Features:

  1. Custom Event Creation: Design and implement application-specific events for real-time monitoring and response.

  2. Observability Tool Integration: Streamline alert ingestion from multiple monitoring platforms.

Webhook Functionality:

  • Facilitates instant, bi-directional communication between applications

  • Enables near real-time data exchange and event propagation

Implementation Benefits:

  • Proactive development approach

  • Improved application responsiveness

  • Enhanced incident detection and management

Note: While Temperstack offers custom integrations for major observability tools, webhook integration provides a flexible solution for less common platforms.


Web hook Integration guide for Temperstack notifications

Step 1 : Create the Webhook on Temperstack

You can create the Webhook Integration Key and URL from Temperstack.

  • Login to Temperstack

  • Notifications -> Temperstack Notifications -> Services

  • Select the service for which you want to create the webhook

  • Enter an integration key name

  • Select Webhook as the integration type

  • Hit Submit

  • Copy the integration URL - Use it in the POST request like described below.

  • Keep the URL safe and secure.

API:

Endpoint 
POST /api/integration/webhook/API_KEY 

This endpoint is used to send alerts via webhooks.

Step 2: Request to be sent through webhook

Request

Method: POST

URL: https://YOUR_ORG.temperstack.com/api/integration/webhook/API_KEY

Headers:

Content-Type: application/json

Request Body

The request body must contain the following fields:

alert_name (Required, String): A brief description of the alert. Example: "Multiple requests are failing."

status (Required, String): The status of the alert. Allowed values: "Alarm" or "OK". Example: "Alarm"

The following fields are optional:

alert_priority (String): The priority of the alert. Allowed values: "Critical" or "Medium". Example: "Critical"

alert_id (String): An optional identifier for the alert. Example: "123456"

description (String): Additional information about the alert. Example: "Too many requests are failing for X"

alert_url (String): A URL associated with the alert. Example: "www.example.com/"

metric_name (String): The name of the metric associated with the alert. Example: "404 Error rate"

resource_id (String): An identifier for the associated resource. Example: "CheckoutAPI"

resource_name (String): The name of the associated resource. Example: "Backend API"

resource_type (String): The type of the associated resource. Example: "API"

run_book_url (String): A URL to the runbook associated with the alert. Example: "www.example.com/checkoutapi_404_error_runbook"

Example

{ 
"alert_name": "Multiple requests are failing", 
"status": "Alarm", 
"alert_priority": "Critical", 
"alert_id": "123456", 
"description": "Too many requests are failing for X", 
"alert_url": "www.example.com/", 
"metric_name": "404 Error rate", 
"resource_id": "CheckoutAPI", 
"resource_name": "Backend API", 
"resource_type": "API", 
"run_book_url": "www.example.com/checkoutapi_404_error_runbook" 
} 

Python Example

import requests 
import json 
url = "https://YOUR_ORG.temperstack.com/api/integration/webhook/API_KEY" 
payload = { 
"alert_name": "Multiple requests are failing", 
"status": "Alarm", 
"alert_priority": "Critical", 
"alert_id": "123456", 
"description": "Too many requests are failing for X", 
"alert_url": "www.example.com/", 
"metric_name": "404 Error rate", 
"resource_id": "CheckoutAPI", 
"resource_name": "Backend API", 
"resource_type": "API", 
"run_book_url": "www.example.com/checkoutapi_404_error_runbook" } 
headers = { 
'Content-Type': 'application/json' 
} 
response = requests.post(url, headers=headers, json=payload) 

print(response.text) 

Response

{ 
"message": "Notification Received" 
} 
Errors 
{ 
"message": "Invalid integration key" 
} 

Response Codes

200: Success

400: Bad Request

Last updated