# `Prometheus.Metric`
[🔗](https://github.com/prometheus-erl/prometheus.ex/blob/v5.1.0/lib/prometheus/metric.ex#L1)

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
if 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

# `parse_spec`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
