Prometheus.io Ecto Instrumenter

Hex.pm Hex.pm Build Status Documentation

Ecto integration for Prometheus.ex

Quickstart

  1. Define your instrumenter:

    defmodule MyApp.Repo.Instrumenter do
    use Prometheus.EctoInstrumenter
    end
  2. Call MyApp.Repo.Instrumenter.setup/0 when application starts (e.g. supervisor setup):

    MyApp.Repo.Instrumenter.setup()
  3. 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:

    def deps do
    [{:prometheus_ecto, "~> 1.2.1"}]
    end
  2. Ensure prometheus_ecto is started before your application:

    def application do
    [applications: [:prometheus_ecto]]
    end