Prometheus.ex v3.0.5 Prometheus.Metric View Source

Prometheus metrics shortcuts.

Aliases and requires respective metric modules so they are accessible without Prometheus.Metric prefix.

Allows to automatically setup metrics with @<type> attributes. Metrics will be declared in the @on_load callback. If the module already has @on_load callback, metrics will be declared iff the callback returns :ok.

Example:

iex(1)> defmodule MyCoolModule do
...(1)>   use Prometheus.Metric
...(1)>
...(1)>   @counter name: :test_counter3, labels: [], help: "qwe"
...(1)> end
iex(2)> require Prometheus.Metric.Counter
Prometheus.Metric.Counter
iex(3)> Prometheus.Metric.Counter.value(:test_counter3)
0

Link to this section Summary

Link to this section Functions