DogStat
This package is based on Statix with one major difference - it receives settings when on GenServer init, allowing to use packages like Confex to resolve configuration from environment at start-time.
Installation
The package can be installed as:
-
Add
dogstatto your list of dependencies inmix.exs:
```elixir
def deps do
[{:dogstat, "~> 0.1.0"}]
end
```-
Ensure
dogstatis started before your application:
```elixir
def application do
[applications: [:dogstat]]
end
```- Add it to your supervision tree:
```elixir
def start(_type, _args) do
import Supervisor.Spec, warn: false
config = [
host: "localhost",
port: 8125
]
children = [
...
worker(Annon.Monitoring.MetricsCollector, [config]),
...
]
opts = [strategy: :one_for_one, name: Annon.Supervisor]
Supervisor.start_link(children, opts)
end
```Docs
The docs can be found at https://hexdocs.pm/dogstat
License
See LICENSE.md.