The fastest way to learn the format
Create a dashboard from a template or in the UI, then export it with the export API or the Export menu option. The exported JSON is the best reference for the available query types and settings.
Define a dashboard as a JSON object and import it using API or UI. This guide builds it up step by step, from an empty dashboard to a full example with charts and alerts.
Create a dashboard from a template or in the UI, then export it with the export API or the Export menu option. The exported JSON is the best reference for the available query types and settings.
Every dashboard starts with a few top-level settings and empty charts and sections arrays:
refresh_interval is in seconds. Use 0 to refresh only on load.date_range_from and date_range_to accept relative expressions such as now-3h and now, or absolute dates.Charts sit on a 12-column grid. Each chart sets its position with x and y and its size with w and h. Sections are horizontal dividers placed at a given y.
This example places two charts side by side under one section. The next section explains the queries:
Available chart types include line_chart, bar_chart, number_chart, table_chart, scatter_chart, and heatmap_chart.
Each chart holds one or more queries in chart_queries. A SQL query uses the {{source}}, {{time}}, {{start_time}}, and {{end_time}} placeholders, and reads metrics with the *Merge aggregate functions and label() for tags.
For the SQL discipline behind these queries, see SQL queries.
Add alerts to a chart in chart_alerts. An alert watches the chart's query and opens an incident when its condition is met:
query_period, recovery_period, aggregation_interval, and check_period are in seconds.escalation_target chooses who is notified when the alert fires.This dashboard combines a section, two charts, a SQL query, and an alert:
Send the JSON to the import API to create the dashboard:
For the full list of fields and settings, see the import API reference.
Please let us know at hello@betterstack.com.
We're happy to help! 🙏
We use cookies to authenticate users, improve the product user experience, and for personalized ads. Learn more.