prometheus-ecto
                                
                                 prometheus-ecto copied to clipboard
                                
                                    prometheus-ecto copied to clipboard
                            
                            
                            
                        Prometheus.io collector for Elixir.Ecto
Prometheus.io Ecto Instrumenter
Ecto integration for Prometheus.ex
- IRC: #elixir-lang on Freenode;
- Slack: #prometheus channel - Browser or App(slack://elixir-lang.slack.com/messages/prometheus).
Quickstart
- 
Define your instrumenter: defmodule MyApp.Repo.Instrumenter do use Prometheus.EctoInstrumenter end
- 
Call MyApp.Repo.Instrumenter.setup/0when application starts (e.g. supervisor setup):MyApp.Repo.Instrumenter.setup()
- 
If using Ecto 2, add MyApp.Repo.Instrumenterto Repo loggers list:config :myapp, MyApp.Repo, loggers: [MyApp.Repo.Instrumenter, Ecto.LogEntry] # ...If using Ecto 3, attach to telemetry in your application start function: :ok = Telemetry.attach( "prometheus-ecto", [:my_app, :repo, :query], MyApp.Repo.Instrumenter, :handle_event, %{} )If using Ecto 3.1 with telemetry 0.4+: :ok = :telemetry.attach( "prometheus-ecto", [:my_app, :repo, :query], &MyApp.Repo.Instrumenter.handle_event/4, %{} )
Integrations / Collectors / Instrumenters
- Ecto collector
- Plugs Instrumenter/Exporter
- Elli middleware
- Fuse plugin
- Phoenix instrumenter
- Process Info Collector
- RabbitMQ Exporter
Installation
Available in Hex, the package can be installed as:
- 
Add :prometheus_ectoto your list of dependencies inmix.exs:def deps do [{:prometheus_ecto, "~> 1.4.3"}] end
- 
Ensure :prometheus_ectois started before your application:def application do [applications: [:prometheus_ecto]] end