Custom webhooks in Telebugs allow you to integrate with any external service that accepts HTTP POST requests. This flexibility enables you to send error notifications to various platforms, such as custom logging systems, incident management tools, or any other service that can process JSON payloads. By using custom webhooks, you can tailor the notification format and content to meet your specific requirements.
To configure a custom webhook, follow these steps:
{{key}}
to insert dynamic values from the error report. Refer to the Webhook template body placeholders section for a list of available keys.
Below is an example of a custom JSON payload that you can use as a starting point:
{ "project_name": "{{project_name}}", "trigger": "{{trigger}}", "subject": "{{subject}}", "culprit": "{{culprit}}", "location": "{{location}}", "error_type": "{{error_type}}", "error_message": "{{error_message}}", "view_url": "{{view_url}}" }
This payload includes key details about the error, such as the project name, trigger event, error type, and a link to the error report. You can customize this structure by adding or removing fields, modifying the keys, or formatting the data to suit your service’s requirements. For instance, you might add a timestamp or reformat the message for better readability.
Note: Ensure that your custom endpoint is configured to accept POST requests and can process the JSON payload correctly. After saving the webhook, use the Test button to verify that the notification is sent and received as expected. This step is crucial to confirm the integration works before relying on it for real error notifications.