# `PromEx.Plugin`
[🔗](https://github.com/akoutmos/prom_ex/blob/master/lib/prom_ex/plugin.ex#L1)

This module defines the behaviour that PromEx plugins need to implement
in order to be properly loaded by PromEx on application start. As a convenience, this
module can also be used as a macro to automatically import all of the necessary utility
functions for writing plugins and also providing default implementations of behaviour
functions that you may not be implementing.

# `event_metrics`

```elixir
@callback event_metrics(keyword()) ::
  [PromEx.MetricTypes.Event.t()] | PromEx.MetricTypes.Event.t()
```

The `c:event_metrics/1` callback returns the configured event based metrics that the
plugin exposes. If the plugin does not expose any event style metrics, there is a
default implementation of this function that returns an empty list. In other words,
if your plugin does not expose any event style metrics, there is no action needed
on your part.

This function is expected to either return a single `PromEx.Plugins.Event` struct
or a list of `PromEx.Plugins.Event` structs.

# `manual_metrics`

```elixir
@callback manual_metrics(keyword()) ::
  [PromEx.MetricTypes.Manual.t()] | PromEx.MetricTypes.Manual.t()
```

The `c:manual_metrics/1` callback returns the configured manual based metrics that the
plugin exposes. If the plugin does not expose any manual style metrics, there is a
default implementation of this function that returns an empty list. In other words,
if your plugin does not expose any manual style metrics, there is no action needed
on your part.

This function is expected to either return a single `PromEx.Plugins.Manual` struct
or a list of `PromEx.Plugins.Manual` structs.

# `polling_metrics`

```elixir
@callback polling_metrics(keyword()) ::
  [PromEx.MetricTypes.Polling.t()] | PromEx.MetricTypes.Polling.t()
```

The `c:polling_metrics/1` callback returns the configured polling based metrics that the
plugin exposes. If the plugin does not expose any polling style metrics, there is a
default implementation of this function that returns an empty list. In other words,
if your plugin does not expose any polling style metrics, there is no action needed
on your part.

This function is expected to either return a single `PromEx.Plugins.Polling` struct
or a list of `PromEx.Plugins.Polling` structs.

---

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