This is a simple monitoring tool most fitting for business monitoring.
It works as a platform inside a phoenix application to periodically run your instruments and display then on the screen.
- If available in Hex, the package can be installed
by adding
dallas
to your list of dependencies inmix.exs
:
def deps do
[
{:dallas, "~> 0.1.0"}
]
end
- Add
dallas_dashboard "/dallas"
to yourrouter.ex
file.
Example:
scope "/", ExampleWeb do
pipe_through :browser
get "/", PageController, :home
dallas_dashboard "/dallas"
end
- Write your own instruments
defmodule YourProject.Instruments.MyInstrument do
use Dallas.Instrument, queue: :default
alias Dallas.Measurement
def measure do
# do whatever you want, REALLY, whatever
# hit APIs, query databases, does not matter
# just return a list (or one) of Dallas.Measurement structs
%Measurement{
path: "Organize/Folders/Whoever/Is/Most/Convenient",
level: :ok, # or :warning, or :error
value: "ok"
}
end
end