PromEx.Plugin behaviour (PromEx v0.1.6-alpha) 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

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

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.

Link to this callback

polling_metrics(keyword)

View Source

Specs

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.