Edit this page on GitHub

Configuration File

This is a list of all supported top-level stanzas in the configuration file. For more information on the semantics of the statements, please refer to the linked pages.

Setting Description
backend Connection string/URL for the backend database (e.g. mysql://localhost:3306/mydb?user=root)
include
metric Declares a metric. See Metric Configuration
unit Declares a unit of measurement. See Units of Measurement
listen_udp Declares a UDP/statsd listener port (A data source).
listen_http Declares a HTTP listener port (A data source).
fetch_http Pull data via HTTP (A data source).
fetch_proc Pull data via HTTP (A data source).
labels Add a global label (this label will apply to all metrics)
label_set Set a (default) label value. See Rewrite Rules

Configuration File Locations

By default, the metrictl program will try to find the configuration file in these locations in the order in which they are listed:

~/.metricttl
/etc/metrictools/metrictl.conf
/etc/metrictl.conf

The metricd program will try these locations in order:

  /etc/metrictools/metricd.conf
  /etc/metricd.conf

You can always explicitly specify the config file location using the --config switch, for example:

$ metrictl --config path/to/metrics.conf ...
$ metricd --config path/to/metrics.conf ...

Full Example

backend "sqlite:///tmp/test.sqlite"

labels "hostname"
label_set hostname localhost default

include "./code/metrictools/etc/units-default.conf"
include "./code/metrictools/plugins/linux/linux-plugin.conf"

collect_http {
  url "http://localhost:9175/eventql/stats"
  interval 10s
  format statsd
  label_set hostname eventql1
}