All Projects → deadtrickster → prometheus-plugs

deadtrickster / prometheus-plugs

Licence: other
Prometheus.erl Elixir Plugs

Programming Languages

elixir
2628 projects
shell
77523 projects

Projects that are alternatives of or similar to prometheus-plugs

prometheus-phoenix
Prometheus.io Phoenix instrumenter
Stars: ✭ 66 (+26.92%)
Mutual labels:  instrumentation, collector
Mtail
extract internal monitoring data from application logs for collection in a timeseries database
Stars: ✭ 3,028 (+5723.08%)
Mutual labels:  instrumentation, collector
elixir plug server timing
Bring Elixir/Phoenix server-side performance metrics 📈 to Chrome's Developer Tools via the Server Timing API. Production Safe™.
Stars: ✭ 49 (-5.77%)
Mutual labels:  plug
dsc
DNS Statistics Collector
Stars: ✭ 94 (+80.77%)
Mutual labels:  collector
RemoteNET
Examine, create and interact with remote objects in other .NET processes.
Stars: ✭ 29 (-44.23%)
Mutual labels:  instrumentation
marathon
Cross-platform test runner written for Android and iOS projects
Stars: ✭ 398 (+665.38%)
Mutual labels:  instrumentation
objectiv-analytics
Powerful product analytics for data teams, with full control over data & models.
Stars: ✭ 399 (+667.31%)
Mutual labels:  instrumentation
plug
A collection of pluggable traits for Eloquent (Laravel) models
Stars: ✭ 13 (-75%)
Mutual labels:  plug
instrumentation
An extensible java agent framework that instruments (modifies the bytecode at class loading time) programs running on the JVM, with the purpose of capturing method invocation events (start, finish, errors ...) and notifying custom listeners.
Stars: ✭ 39 (-25%)
Mutual labels:  instrumentation
jetty-load-generator
jetty-project.github.io/jetty-load-generator/
Stars: ✭ 62 (+19.23%)
Mutual labels:  collector
do
Simplest way to manage asynchronicity
Stars: ✭ 33 (-36.54%)
Mutual labels:  collector
pyccolo
Declarative instrumentation for Python.
Stars: ✭ 70 (+34.62%)
Mutual labels:  instrumentation
contech
The Contech analysis framework provides the means for generating and analyzing task graphs that enable computer architects and programmers to gain a deeper understanding of parallel programs.
Stars: ✭ 43 (-17.31%)
Mutual labels:  instrumentation
dns-collector
Aggregator, analyzer, transporter and logging for your DNS logs
Stars: ✭ 58 (+11.54%)
Mutual labels:  collector
mediadc
Nextcloud Media Duplicate Collector application
Stars: ✭ 57 (+9.62%)
Mutual labels:  collector
plug canonical host
PlugCanonicalHost ensures that all requests are served by a single canonical host.
Stars: ✭ 26 (-50%)
Mutual labels:  plug
qinst
Draft of generic instrumentation tool based on QEMU using eBPF to implement trivial instrumentations with trivial code
Stars: ✭ 17 (-67.31%)
Mutual labels:  instrumentation
taeseung vimrc
Taeseung Lee's vim setting
Stars: ✭ 16 (-69.23%)
Mutual labels:  plug
console
Oracle Instrumentation Console: Lightweight PL/SQL logging tool inspired by the JavaScript Console
Stars: ✭ 14 (-73.08%)
Mutual labels:  instrumentation
alternate
Plug and Phoenix helpers to localize your web app via the URL
Stars: ✭ 26 (-50%)
Mutual labels:  plug

Prometheus.io Plugs Instrumenter/Exporter

Build Status Module version Documentation Total Download License Last Updated

Elixir Plug integration for prometheus.ex

Quick introduction by @skosch: Monitoring Elixir apps in 2016: Prometheus/Grafana Step-by-Step Guide

  • IRC: #elixir-lang on Freenode;
  • Slack: #prometheus channel - Browser or App(slack://elixir-lang.slack.com/messages/prometheus).

Instrumentation

To instrument whole plug pipeline use Prometheus.PlugPipelineInstrumenter:

defmodule MyApp.Endpoint.PipelineInstrumenter do
  use Prometheus.PlugPipelineInstrumenter
end

To instrument just a single plug use Prometheus.PlugInstrumenter:

defmodule MyApp.CoolPlugInstrumenter do
  use Prometheus.PlugInstrumenter, [plug: Guardian.Plug.EnsureAuthenticated,
                                    counter: :guardian_ensure_authenticated_total,
                                    histogram: :guardian_ensure_authenticated_duration_microseconds,
                                    labels: [:authenticated]]
end

Both modules implement plug interface and Prometheus.PlugInstrumenter generates proxy for specified plug so you'll need to replace instrumented plug with your instrumenter in pipeline.

Instrumenters configured via :prometheus app environment. Please consult respective modules documentation on what options are available.

Exporting

To export metric we first have to create a plug that will serve scraping requests.

defmodule MyApp.MetricsExporter do
  use Prometheus.PlugExporter
end

Call the MyApp.MetricsExporter.setup/0 function when the application starts.

# e.g. in `application.ex`
MyApp.MetricsExporter.setup()

Then we add exporter to MyApp pipeline:

plug MyApp.MetricsExporter

You can configure path, export format and Prometheus registry via :prometheus app environment. For more information please see Prometheus.PlugExporter module documentation.

Export endpoint can be secured using HTTP Basic Authentication:

  auth: {:basic, "username", "password"}

Integrations / Collectors / Instrumenters

Installation

The package can be installed as:

  1. Add :prometheus_plug to your list of dependencies in mix.exs:

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

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

License

This project is licensed under the MIT license. Copyright (c) 2016-present, Ilya Khaprov.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].