PromEx.Plugin behaviour (PromEx v1.1.1) View Source
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.
Link to this section Summary
Callbacks
The 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.
The 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.
The 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.
Link to this section Callbacks
Specs
event_metrics(keyword()) :: [PromEx.MetricTypes.Event.t()] | PromEx.MetricTypes.Event.t()
The 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.
Specs
manual_metrics(keyword()) :: [PromEx.MetricTypes.Manual.t()] | PromEx.MetricTypes.Manual.t()
The 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.
Specs
polling_metrics(keyword()) :: [PromEx.MetricTypes.Polling.t()] | PromEx.MetricTypes.Polling.t()
The 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.