Module exometer_folsom_monitor

Hook API for following folsom-based legacy code with exometer.

Behaviours: gen_server.

This module defines the exometer_folsom_monitor behaviour.
Required callback functions: copy_folsom/3.

Description

Hook API for following folsom-based legacy code with exometer

This module installs hooks into folsom, allowing subscribers to trap the creation of metrics using the folsom API, and instruct exometer to create matching metrics entries.

Subscriptions identify a module that should be on the call stack when a module is created (when testing from the shell, use the module shell), and a callback module which is used to retrieve the specs for exometer metrics to create.

Function Index

monitor/2Monitor a legacy module.
start_link/0Start the server (called automatically by exometer).

Function Details

monitor/2

monitor(FromMod::atom(), Callback::atom()) -> ok

Monitor a legacy module.

FromMod is the name of a module that should appear on the call stack when a call to folsom_metrics:new_<Type> is made (or '_', which will match any call stack). Callback is a callback module, exporting the function copy_folsom(Name,Type,Opts), which returns a {Name, Type, Options} tuple, a list of such tuples, or the atom false.

The callback module is called from the exometer_folsom_monitor process, so the call stack will not contain the legacy modules. However, if the corresponding exometer metrics end up calling other folsom-based metrics (e.g. using the exometer_folsom module), there will be a risk of generating a loop.

start_link/0

start_link() -> any()

Start the server (called automatically by exometer).


Generated by EDoc