Shell and CI pipelines
Send readings or command outcomes from your own scripts and build pipelines.
On this page
What you need
curl, the example's runtime and a device key supplied as a protected file by your secret store.
How to do it
- Create a monitor and series for the reading, or a Job monitor for a command.
- Use the shell example below for numbers or metribeacon run for command start and outcome.
- Check the HTTP response and the monitor. Keep the prepared request for any temporary retry.
Good to know
The example passes the authorization header through standard input, keeping the key out of curl's command arguments. Disable shell tracing when handling secrets.
A monitoring request can fail while your build succeeds. Use the run wrapper's strict mode only if you want reporting failure to affect its exit status.
metribeacon run --monitor-id MONITOR_UUID -- /usr/local/bin/ci-check
metribeacon run flush --jsonIf something goes wrong
Do not use set -x around keys. Check the source task's result separately from the monitoring response.
Related guides
- Send your own monitoring data
Send your own readings over HTTPS using the IDs and keys of your monitor.
- Run commands and retry offline reports
Report a command's execution while preserving its output and exit status.
- Monitor jobs and cron schedules
Track scheduled commands and find failed, late or missing executions.