DogStat

Deps StatusHex.pm DownloadsLatest VersionLicenseBuild StatusCoverage StatusEbert

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:

  1. Add dogstat to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:dogstat, "~> 0.1.0"}]
end
```
  1. Ensure dogstat is started before your application:
```elixir
def application do
  [applications: [:dogstat]]
end
```
  1. 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.