MetriBeacon
Menu

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

  1. Create a monitor and series for the reading, or a Job monitor for a command.
  2. Use the shell example below for numbers or metribeacon run for command start and outcome.
  3. 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.

shell
metribeacon run --monitor-id MONITOR_UUID -- /usr/local/bin/ci-check
metribeacon run flush --json

If something goes wrong

Do not use set -x around keys. Check the source task's result separately from the monitoring response.