dashboards commands list, create, and update an app’s dashboards, and show, add, and update the charts on them.
Each command targets one application, by name and environment (--app "MyApp" --environment production) or by ID (--app-id <APP_ID>, the long hexadecimal app ID from appsignal-cli apps list). The --environment flag is only needed when several apps share a name. Each command uses your default organization unless you pass --org. See Apps and organizations for how apps are identified.
List dashboards
Shell
Show a dashboard
To see a dashboard’s details and its charts, pass the dashboard’s--id:
Shell
--output json, the charts are in dashboard.visuals, each with its id, its type in __typename, and its settings. add-visual and update-visual return the same shape.
Create a dashboard
A new dashboard needs a title and a description:Shell
Update a dashboard
Pass the dashboard’s--id (from dashboards list) along with the new title:
Shell
--title is required even when you only change the description.
Add a chart
You describe a chart in a JSON file, then add it withadd-visual. Say you run an online store. Your Checkout health dashboard should answer two questions: is checkout slow, and is it failing?
To see how slow checkout is for your slowest customers, chart its 95th percentile response time over time. That’s a timeseries chart. Save it as checkout-speed.json:
checkout-speed.json
Shell
number chart, which takes a single metric. Save it as checkout-errors.json:
checkout-errors.json
Shell
CheckoutsController#create with the action that handles checkout in your app. Every new chart needs a nonempty title and description. To read the JSON from standard input instead of a file, pass --file -.
The CLI doesn’t retry a failed chart creation. If
add-visual fails with a network error, check the dashboard with dashboards show before you retry. That way, you don’t add the chart twice.Update a chart
To change a chart, pass only the settings you want to change. Everything else stays as it is. For example, to show the checkout response time as an area chart, get the chart’s ID fromdashboards show and run:
Shell
update-visual takes the same app flags as add-visual, plus:
A few settings need more care:
- Lists and objects are replaced whole. To also chart the payment step, pass
metricswith both the checkout metric and the new one. To move a chart, pass all fourlayoutvalues. - To clear a setting, set it to
null. This works fordescription,formatInput,layout,lineLabel,minYAxis, and a number chart’smetric.formatcan’t be cleared, so set it to another format instead. - To remove all of a timeseries chart’s metrics, pass
"metrics": []. - Changing
formataway fromsizealso clearsformatInput.
Chart settings
Chart JSON uses camelCase keys and holds settings only. The dashboard ID, chart ID, and chart type go in the command flags. Unknown keys, invalid values, and settings for the other chart type return an error.
These settings take a fixed set of values: