# `Instruments.Probes.Allocators`

A probe that reports per-allocator memory statistics.

This probe reports three metrics, all derived from `:recon_alloc`:

  * `by_allocator`: the memory allocated by each allocator, as reported by
    `:recon_alloc.memory(:allocated_types)`. A single metric is emitted per
    allocator, tagged with `allocator:<name>`.
  * `backing_carriers`, `backing_carriers_size`: the number of carriers (and
    their total size) allocated by each backing allocator, summed across every
    allocator instance reported by `:recon_alloc.allocators/0`. One metric is
    emitted per backing allocator, tagged with `allocator:<name>` (one of
    `mseg_alloc` or `sys_alloc`).

To use this probe, register it with the matching keys:

    alias Instruments.{Probe, Probes}
    Probe.define!("recon.alloc.allocated", :gauge,
      module: Probes.Allocators,
      keys: ~w(
        by_allocator
        backing_carriers
        backing_carriers_size
      )a
    )

All three keys are then reported under `recon.alloc.allocated.<key>`.

---

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