Page MenuHomePhorge

No OneTemporary

Size
5 KB
Referenced Files
None
Subscribers
None
diff --git a/README.md b/README.md
index 73c50b3..4677289 100644
--- a/README.md
+++ b/README.md
@@ -1,90 +1,90 @@
# Prometheus.ex
[![Build Status](https://travis-ci.org/deadtrickster/prometheus.ex.svg?branch=master)](https://travis-ci.org/deadtrickster/prometheus.ex)
[![Hex.pm](https://img.shields.io/hexpm/dt/prometheus_ex.svg?maxAge=2592000)](https://hex.pm/packages/prometheus_ex)
[![Coverage Status](https://coveralls.io/repos/github/deadtrickster/prometheus.ex/badge.svg?branch=master)](https://coveralls.io/github/deadtrickster/prometheus.ex?branch=master)
[![Hex.pm](https://img.shields.io/hexpm/v/prometheus_ex.svg?maxAge=2592000)](https://hex.pm/packages/prometheus_ex)
[![Documentation](https://img.shields.io/badge/documentation-on%20hexdocs-green.svg)](https://hexdocs.pm/prometheus_ex/)
Elixir [Prometheus.io](https://prometheus.io) client based on [Prometheus.erl](https://github.com/deadtrickster/prometheus.erl).
![@skosch dashboard](http://aldusleaf.org/content/images/2016/09/grafana.jpg)
Dashboard from [Monitoring Elixir apps in 2016: Prometheus and Grafana](http://aldusleaf.org/monitoring-elixir-apps-in-2016-prometheus-and-grafana/) by [**@skosch**](https://github.com/skosch).
- IRC: #elixir-lang on Freenode;
- [Slack](https://elixir-slackin.herokuapp.com/): #prometheus channel - [Browser](https://elixir-lang.slack.com/messages/prometheus) or App(slack://elixir-lang.slack.com/messages/prometheus).
## Example
```elixir
defmodule ExampleInstrumenter do
use Prometheus.Metric
def setup do
Histogram.new([name: :http_request_duration_milliseconds,
labels: [:method],
buckets: [100, 300, 500, 750, 1000],
help: "Http Request execution time"])
end
def instrument(%{time: time, method: method}) do
Histogram.observe([name: :http_request_duration_milliseconds, labels: [method]], time)
end
end
```
or
```elixir
defmodule ExampleInstrumenter do
use Prometheus.Metric
@histogram [name: :http_request_duration_milliseconds,
labels: [:method],
buckets: [100, 300, 500, 750, 1000],
help: "Http Request execution time"]
def instrument(%{time: time, method: method}) do
Histogram.observe([name: :http_request_duration_milliseconds, labels: [method]], time)
end
end
```
Here histogram will be declared in auto-generated `@on_load` callback, i.e.
you don't have to call setup manually.
Please read how to [measure durations correctly with prometheus.ex](https://hexdocs.pm/prometheus_ex/time.html#content).
## Integrations / Collectors / Instrumenters
- [Ecto collector](https://github.com/deadtrickster/prometheus-ecto)
- [Elli middleware](https://github.com/elli-lib/elli_prometheus)
- [Extatus - App to report metrics to Prometheus from Elixir GenServers](https://github.com/gmtprime/extatus)
- [Plugs Instrumenter/Exporter](https://github.com/deadtrickster/prometheus-plugs)
- [Fuse plugin](https://github.com/jlouis/fuse#fuse_stats_prometheus)
- [OS process info Collector](https://hex.pm/packages/prometheus_process_collector) (linux-only)
- [Phoenix instrumenter](https://github.com/deadtrickster/prometheus-phoenix)
- [RabbitMQ Exporter](https://github.com/deadtrickster/prometheus_rabbitmq_exporter)
## Dashboards
- [Beam Dashboards](https://github.com/deadtrickster/beam-dashboards).
## Installation
[Available in Hex](https://hex.pm/packages/prometheus_ex), the package can be installed as:
1. Add `prometheus_ex` to your list of dependencies in `mix.exs`:
```elixir
def deps do
- [{:prometheus_ex, "~> 2.0"}]
+ [{:prometheus_ex, "~> 3.0"}]
end
```
2. Ensure `prometheus_ex` is started before your application:
```elixir
def application do
[applications: [:prometheus_ex]]
end
```
diff --git a/mix.exs b/mix.exs
index 1d9e12d..564a843 100644
--- a/mix.exs
+++ b/mix.exs
@@ -1,72 +1,72 @@
defmodule PrometheusEx.Mixfile do
use Mix.Project
- @version "2.0.0"
+ @version "3.0.0"
def project do
[
app: :prometheus_ex,
version: @version,
elixir: "~> 1.6",
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
description: description(),
package: package(),
name: "Prometheus.ex",
deps: deps(),
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [coveralls: :test, "coveralls.html": :test],
docs: [
main: Prometheus,
source_ref: "v#{@version}",
source_url: "https://github.com/deadtrickster/prometheus.ex",
extras: [
"pages/Mnesia Collector.md",
"pages/VM Memory Collector.md",
"pages/VM Statistics Collector.md",
"pages/VM System Info Collector.md",
"pages/Time.md"
]
]
]
end
def application do
[applications: [:logger, :prometheus]]
end
defp description do
"""
Elixir-friendly Prometheus monitoring system client.
"""
end
defp package do
[
maintainers: ["Ilya Khaprov"],
licenses: ["MIT"],
links: %{
"GitHub" => "https://github.com/deadtrickster/prometheus.ex",
"Prometheus.erl" => "https://hex.pm/packages/prometheus",
"Inets HTTPD Exporter" => "https://hex.pm/packages/prometheus_httpd",
"Ecto Instrumenter" => "https://hex.pm/packages/prometheus_ecto",
"Phoenix Instrumenter" => "https://hex.pm/packages/prometheus_phoenix",
"Plugs Instrumenter/Exporter" => "https://hex.pm/packages/prometheus_plugs",
"Process info Collector" => "https://hex.pm/packages/prometheus_process_collector"
}
]
end
defp deps do
[
{:prometheus, "~> 4.0"},
## test
{:credo, "~> 0.8", only: [:dev, :test]},
{:dialyxir, "~> 0.5", only: [:dev]},
{:earmark, "~> 1.2", only: [:dev]},
{:ex_doc, "~> 0.18", only: [:dev]},
{:excoveralls, "~> 0.8", only: [:test]},
]
end
end

File Metadata

Mime Type
text/x-diff
Expires
Wed, Nov 27, 3:48 PM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40684
Default Alt Text
(5 KB)

Event Timeline