Docs
DocumentationQuery ReferenceAPI Reference
Open Console→→
DocumentationQuery ReferenceAPI Reference

Platform overview

What is Axiom?QuickstartArchitectureFeatures
Fundamentals
Datasets
Edge deployments
Limits
Performance
Optimize usage
Requirements
Semantic conventions
Glossary
Tour
SecurityRoadmap

Send data

Reference architecturesMethods

Understand data

Console
Query
Builder
Editor
Query results
Visualize
Traces
Metrics
Correlations
Save queries
Stream
Dashboard
Create
Elements
Create
Configure
Element types
Gauge
Heatmap
Log stream
Monitor list
Note
Pie chart
Scatter plot
Statistic
Table
Time series
Sections
Configure
Filter
Monitor
Overview
View status
Configure
Examples
Monitor types
Anomaly
Match
New values
Threshold
Alerting
Overview
Configure
Notifier types
Amp
ChatGPT Workspace Agent
Claude Code
Cursor
Custom Webhook
Discord
Email
incident.io
Jira Service Management
Microsoft Teams
Opsgenie
PagerDuty
Slack
Annotations
Command Menu
Manage
Datasets
Overview
Views
Virtual fields
Access
RBAC
Tokens
CLI
Organization
Labels
Audit log
Settings
Usage and billing
Profile
Extend
Overview
AWS Lambda
AWS PrivateLink
Cloudflare Workers
Cloudflare Logpush
Convex
Grafana
Hex
Netlify
Supabase
Supabase metrics
Tailscale
Terraform
Unkey
Vercel
Intelligence
Overview
Spotlight
AI agents
Overview
MCP Server
Overview
Tools
Query cost limits
Agent-created orgs
Skills
Overview
Axiom alerting
Build dashboards
Control costs
SRE
Translate SPL to APL
Splunk
Overview
Splunk app
Install and configure
Commands
Traces
Examples
Portal
How it works
Set up standard mode
Set up transparent mode
Observability Cloud
OCSF data
OCSF as CIM
SPL command support
Examples
Monitor and troubleshoot

Use cases

ObservabilityProduct analytics
OCSF security data
Overview
Send data
Query data
LLM observability
Overview
Use Vercel AI SDK
Manual instrumentation
OpenAI Agents SDK
GenAI attributes
Redaction policies

Miscellaneous

LLMs
Overview
List of docs pages
Full docs
Query reference
FAQs
Legal
Acceptable use policy
Axiom for Startups terms
Committed use terms
Cookies
Data processing
HIPAA
Partner agreement
Partner program guide
Privacy policy
SLA
Terms of service
Terms of use
Understand data/Console

Custom webhook notifier

This page explains how to create and configure a custom webhook notifier.

Use a custom webhook notifier to connect your monitors to internal or external services. The webhook URL receives a POST request with a content type of application/json together with any other headers you specify.

To create a custom webhook notifier, follow these steps:

  1. In Axiom, click Notifiers in the sidebar.
  2. Click New notifier on the top right.
  3. Name your notifier.
  4. Click Custom webhook.
  5. In Webhook URL, enter the URL where you want to send the POST request. The URL must use HTTPS. Axiom rejects http:// URLs when you save or test the notifier.
  6. Optional: To customize the content of your webhook, use the Go template syntax to interact with these variables:
    • .Action has value Open when the notification corresponds to a match monitor matching, a new values monitor finding a new value, or a threshold or anomaly monitor triggering, and has value Closed when a threshold or anomaly monitor resolves.
    • .MonitorID is the unique identifier for the monitor associated with the notification.
    • .MonitorURL is a link to the monitor in Axiom.
    • .Query is the APL or MPL query of the monitor associated with the notification.
    • .QueryURL is a link that opens the query of the monitor in Axiom over the time range of the notification. It’s empty if Axiom can’t build the link.
    • .Name is the name of the monitor.
    • .MonitorType is the type of the monitor.
    • .Labels is an array of labels associated with the notification.
    • .Threshold and .Operator are the monitor’s configured threshold and comparison operator.
    • .Range and .Interval are the query range and run interval in minutes.
    • .ID is the notification event ID.
    • .UUID is a UUID generated for the webhook message.
    • .Body contains the notification message. For match monitors, it contains Event Matched and a rate-limit note when applicable. For new values monitors, it contains the accompanying text or New Value if none was provided. For threshold or anomaly monitors, it describes the value that triggered or resolved the alert. Use .MatchedEvent to read the matching event or new value row.
    • .Description is the description of the monitor associated with the notification.
    • .QueryEndTime is the end time applied in the monitor query that gave rise to the notification.
    • .QueryStartTime is the start time applied in the monitor query that gave rise to the notification.
    • .Timestamp is the time the notification was generated.
    • .Title is the notification title.
    • .Value is the value that gave rise to the monitor triggering or resolving. It applies to threshold and anomaly monitors. When a threshold or anomaly monitor resolves because its query stops returning data for a series (for example, a grouped series that goes idle or drops out), there’s no current value to report and .Value is 0.
    • .MatchedEvent is a JSON object. It’s only applicable if the notification corresponds to a match monitor or a new values monitor. For a match monitor, it’s the event that matched the criteria of the monitor. For a new values monitor, it’s one row of the query results that holds the new value.
    • .GroupKeys and .GroupValues are JSON arrays that contain the keys and the values returned by the group-by attributes of your query. They’re only applicable if the APL query of the monitor groups by a non-time field. You can fully customize the content of the webhook to match the requirements of your environment.
  7. Optional: In Webhook headers, add headers to the POST request. For sensitive values such as authentication tokens, use Webhook secret headers. Axiom encrypts these values and hides them when you edit the notifier.
  8. Click Create.

Template functions

Use jsonObject to include .MatchedEvent as a JSON object, and jsonArray to include arrays such as .GroupKeys or .Labels.

Use jsonString to quote a string as JSON, for example "name": {{jsonString .Name}}. To include the matched event as a string, use "event": "{{escapedJSON .MatchedEvent}}".

Examples

The example below is the default template for a custom webhook notification:

JSON
{
  "action": "{{.Action}}",
  "event": {
    "monitorID": "{{.MonitorID}}",
    "body": "{{.Body}}",
    "description": "{{.Description}}",
    "queryEndTime": "{{.QueryEndTime}}",
    "queryStartTime": "{{.QueryStartTime}}",
    "timestamp": "{{.Timestamp}}",
    "title": "{{.Title}}",
    "value": {{.Value}},
    "matchedEvent": {{jsonObject .MatchedEvent}},
    "groupKeys": {{jsonArray .GroupKeys}},
    "groupValues": {{jsonArray .GroupValues}}
  }
}

Using the template above, the body of a POST request sent to the webhook URL for a threshold monitor triggering:

JSON
{
  "action": "Open",
  "event": {
    "monitorID": "CabI3w142069etTgd0",
    "body": "Current value of 57347 is above or equal to the threshold value of 0",
    "description": "",
    "queryEndTime": "2024-06-28 14:55:57.631364493 +0000 UTC",
    "queryStartTime": "2024-06-28 14:45:57.631364493 +0000 UTC",
    "timestamp": "2024-06-28 14:55:57 +0000 UTC",
    "title": "Axiom Monitor Test Triggered",
    "value": 57347,
    "matchedEvent": null,
    "groupKeys": null,
    "groupValues": null
  }
}

The example template below formats the webhook message to match the expectations of incident.io using the monitor ID as the deduplication_key. To use the native integration, see incident.io notifier.

JSON
{
  "title": "{{.Title}}",
  "description": "{{.Body}}",
  "deduplication_key": "{{.MonitorID}}",
  "status": "{{ if eq .Action "Open" }}firing{{ else }}resolved{{ end }}",
  "metadata": {
    "description": "{{.Description}}",
    "value": {{.Value}}
  },
  "source_url": "{{.MonitorURL}}"
}

The example template below sends the query and the links that your own automation needs to start an investigation when a monitor alerts:

JSON
{
  "title": "{{.Title}}",
  "action": "{{.Action}}",
  "query": "{{.Query}}",
  "queryURL": "{{.QueryURL}}",
  "monitorURL": "{{.MonitorURL}}"
}
Was this page helpful?
Suggest edits on GitHub
PreviousCursor notifierNextDiscord notifier
On this page
Template functionsExamples