Add a webhook notification channel
1
Open the integrations page
Go to Integrations in the TrueFoundry UI and click Add Integration Provider.
2
Select Custom
Choose Custom as the provider type and give the provider account a name.
3
Add the integration
Add an integration, choose Webhook Notification Channel, and fill in the fields below.
4
Save
Click Add Integration Provider to save.
Fields
The endpoint must be reachable from the TrueFoundry control plane. When SSRF protection is enabled on the control plane, URLs that resolve to private or internal network addresses are blocked.
Use the channel
Select Webhook as the notification target of a budget alert and pick the integration from the Notification Channel dropdown. In a budget,notification_target is a list under alerts:
notification_channel value with the FQN of your integration.
Request format
Every notification is sent asPOST with Content-Type: application/json.
Event types
Thetype field tells you which shape data has.
Budget threshold crossed
Sent astype: "budget.threshold_crossed" when usage crosses an alert threshold.
Test notification
The channel test sendstype: "test" with an empty data object.
Delivery and retries
- A
2xxresponse marks the notification as delivered. Any other response, a timeout (10 seconds), or a connection error fails the attempt, and TrueFoundry retries it, up to 3 attempts in total. - Delivery is at-least-once. Your endpoint can receive the same notification more than once, so deduplicate on
id. - Respond quickly and process asynchronously. Slow responses are treated as failures.
Example: notify a user through a relay
Budget alerts name the breaching user indata.entity.value. A small service can use it to message that person, for example with Slack’s users.lookupByEmail and chat.postMessage:
For Slack direct messages without a relay, you can also use the Slack Bot target with Slack User Emails.