Configuration
statix
Statix
After the underlying Statix library is configured, Instruments requires little configuration.
To configure Statix, include the following in your config/config.exs file:
config :statix,
prefix: "#{Mix.env}",
host: "localhost",
port: 15339 This should be pretty self-explanatory, other than you'll have a metric prefix of your
Mix.env for all metrics, so if you defined a metric named my_server.requests_per_second it would be
converted to prod.my_server.requests_per_second.
More information can be found on the Statix GitHub page.
instruments-specific-config
Instruments-Specific Config
There are a couple of Instruments specific application variables:
reporter_module: TheInstruments.StatsReporterthat emits statistics for the application. Defaultsto `Instruments.Statix`.fast_counter_report_interval: How often counters should send data to thereporter_module, in milliseconds.Defaults to 10 seconds.fast_counter_report_jitter_range: How much random jitter should be applied to the reporting interval, in milliseconds.Defaults to half a second before and after the reporting interval.probe_prefix: A global prefix to apply to all probes.statsd_port: The port that the statsd server listens on. Should be the same as the port in the statixconfiguration above.
For example:
config :instruments,
reporter_module: Instruments.StatsReporter.Logger,
fast_counter_report_interval: 30_000,
fast_counter_report_jitter_range: -700..700,
probe_prefix: "probes",
statsd_port: 15339