Skip to content

Instantly share code, notes, and snippets.

@sb8244
Created February 7, 2018 22:26
Show Gist options
  • Save sb8244/c90be3ab8beac229857ca8278ebc28dc to your computer and use it in GitHub Desktop.
Save sb8244/c90be3ab8beac229857ca8278ebc28dc to your computer and use it in GitHub Desktop.
My exometer.exs standard installation
# mix.exs deps
# start exometer; force "correct" modules due to elixometer not compiling properly
{:elixometer, "~> 1.2"},
{:lager, ">= 3.2.1", override: true},
{:exometer, github: "Feuerlabs/exometer"},
{:exometer_core, "~>1.4.0", override: true},
{:amqp_client, git: "https://github.com/dsrosario/amqp_client.git", branch: "erlang_otp_19", override: true},
# end exometer
# dev.exs
import_config "exometer.exs"
config :exometer_core,
reporters: [
exometer_report_statsd: [
hostname: 'localhost',
port: (System.get_env("STATSD_PORT") || "8125") |> String.to_integer()
],
]
# exometer.exs
use Mix.Config
polling_interval = 1_000
memory_stats = ~w(atom binary ets processes total)a
config :exometer_core,
predefined: [
{
~w(app_name erlang memory)a,
{:function, :erlang, :memory, [], :proplist, memory_stats},
[]
},
{
~w(app_name erlang statistics)a,
{:function, :erlang, :statistics, [:'$dp'], :value, [:run_queue]},
[]
},
],
reporters: [
exometer_report_lager: [],
],
report: [
subscribers:
[
{
:exometer_report_statsd,
[:app_name, :erlang, :memory], memory_stats, polling_interval, true
},
{
:exometer_report_statsd,
[:app_name, :erlang, :statistics], :run_queue, polling_interval, true
},
]
]
config :elixometer,
reporter: :exometer_report_statsd,
env: Mix.env,
metric_prefix: "app_name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment