Prometheus.io Ecto Instrumenter

Hex.pmBuild StatusDocumentation

Ecto integration for Prometheus.ex

Quickstart

  1. Define your instrumenter:
  defmodule MyApp.Repo.Instrumenter do
    use Prometheus.EctoInstrumenter
  end
  1. Call MyApp.Repo.Instrumenter.setup/0 when application starts (e.g. supervisor setup):
  MyApp.Repo.Instrumenter.setup()
  1. Add MyApp.Repo.Instrumenter to Repo loggers list:
  config :myapp, MyApp.Repo,
    ...
    loggers: [MyApp.Repo.Instrumenter, Ecto.LogEntry]
    ...

Integrations / Collectors / Instrumenters

Installation

Available in Hex, the package can be installed as:

  1. Add prometheus_ecto to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:prometheus_ecto, "~> 1.0.0-alpha4"}]
end
```
  1. Ensure prometheus_ecto is started before your application:
```elixir
def application do
  [applications: [:prometheus_ecto]]
end
```