This repository contains the Metrist Agent, which includes two main functions:

The agent is written in Elixir and distributed both as a stand-alone executable and a container.


Based on monitor configurations maintained on the Metrist backend, the orchestrator will schedule runs of checks for certain monitors. It is configured with an instance id that allows the backend to keep track of when something was last run and one or more "run groups" that allow the backend to decide what monitors and checks are configured to run on that particular instance of the orchestrator.

When a monitor is up for its run, it is downloaded from a Metrist-managed S3 bucket so that the latest version of a monitor is always executed; it is then started and the monitor is expected to participate in a simple procotol to exchange configuration data and have the orchestrator drive the monitoring code through the configured scenario. For every step, a timing is obtained and the orchestrator sends that back to the Metrist backend.

In-process forwarding

The Monitoring Agent comes with a handler for in-process monitoring. For every Metrist In-Process Agent (IPA) message it receives, it will try to match the messages against its configuration to see whether it needs to be forwarded to the Metrist back-end.

IPA messages consist of four fields: the HTTP method, the url, the path, and the time it took for the HTTP transaction to complete. A configuration file can be specified by pointing the environment variable CANARY_CMA_CONFIG to a Yaml file with contents similar to this snippet:

    method: any
    host: api.*.braintreegateway.com
    url: /transaction$

You can specify as many patterns as you like. The key is in the format "monitor-name.check-name", which you can both obtain from our web UI. method and url can both be left out or for clarity specified as "any" in which case everything matches. All three fields are normal regular expressions that are matched against the corresponding fields in the IPA message. If it matches, the measured value will be sent to the Metrist back-end.


The agent is configured through environment variables: