start_link/0 | Starts the server
+
@@ -405,6 +407,13 @@ list_subscriptions(Reporter::module()) -> [{metric()
`remove_reporter(Reporter) -> any()`
+
+
+### remove_reporter/2 ###
+
+`remove_reporter(Reporter, Reason) -> any()`
+
+
### setopts/3 ###
diff --git a/doc/exometer_report_snmp.md b/doc/exometer_report_snmp.md
index a1ee7cf..67b295e 100644
--- a/doc/exometer_report_snmp.md
+++ b/doc/exometer_report_snmp.md
@@ -100,7 +100,7 @@ Callback function used by the SNMP master agent upon operations performed by a m
### exometer_setopts/4 ###
-`exometer_setopts(Metric, Options, X3, St0) -> any()`
+`exometer_setopts(Exometer_entry, Options, X3, St0) -> any()`
diff --git a/doc/overview.edoc b/doc/overview.edoc
index 604733d..fa79c36 100644
--- a/doc/overview.edoc
+++ b/doc/overview.edoc
@@ -571,8 +571,8 @@ Below is an example, from `exometer/priv/app.config':
{exometer, [
- {report, [
- {subscribers, [
+ {report, [
+ {subscribers, [
{exometer_report_collectd, [db, cache, hits], mean, 2000, true},
{exometer_report_collectd, [db, cache, hits], max, 5000, false}
]}
@@ -585,35 +585,50 @@ how to configure individual plugins.
The `subscribers' sub-section contains all static subscriptions to be
setup att exometer applications start. Each tuple in the prop list
-contains five elements:
+should be of one of the following formats:
+
+`{Reporter, Metric, DataPoint, Interval}'
+`{Reporter, Metric, DataPoint, Interval, RetryFailedMetrics}'
+`{Reporter, Metric, DataPoint, Interval, RetryFailedMetrics, Extra}'
+`{apply, {M, F, A}}'
+
+In the case of `{apply, M, F, A}', the result of `apply(M, F, A)' must
+be a list of `subscribers' tuples.
+
+The meaning of the above tuple elements is:
-+ `receiver' (module name atom)
++ `Reporter :: module()'
Specifies the reporter plugin module, such as
`exometer_report_collectd' that is to receive updated metric's data
points.
-+ `name' (list of atoms)
++ `Metric :: [atoms()]'
Specifies the path to a metric previously created with an
`exometer:new()' call.
-+ `datapoint' (atom)
++ `DataPoint' :: atom() | [atom()]'
Specifies the data point within the given metric to send to the
receiver. The data point must match one of the data points returned by
`exometer:info(Name, datapoints)' for the given metrics name.
-+ `interval' (milliseconds)
++ `Interval' :: integer()' (milliseconds)
Specifies the interval, in milliseconds, between each update of the
given metric's data point. At the given interval, the data point will
be samples, and the result will be sent to the receiver.
-+ `retry_failed_metrics (true | false)'
++ `RetryFailedMetrics :: boolean()'
Specifies if the metric should be continued to be reported
even if it is not found during a reporting cycle. This would be
the case if a metric is not created by the time it is reported for
the first time. If the metric will be created at a later time,
this value should be set to true. Set this value to false if all
attempts to report the metric should stop if when is not found.
+ The default value is `true'.
++ `Extra :: any()'
+ Provides a means to pass along extra information for a given
+ subscription. An example is the `syntax' option for the SNMP reporter,
+ in which case `Extra' needs to be a property list.
=== Configuring reporter plugins ===
diff --git a/src/exometer_report.erl b/src/exometer_report.erl
index 8c8fa2c..99910f6 100644
--- a/src/exometer_report.erl
+++ b/src/exometer_report.erl
@@ -918,6 +918,10 @@ init_subscriber({Reporter, Metric, DataPoint, Interval, RetryFailedMetrics, Extr
init_subscriber({Reporter, Metric, DataPoint, Interval}, Acc) ->
[subscribe_(Reporter, Metric, DataPoint, Interval, true, undefined) | Acc];
+
+init_subscriber({apply, {M, F, A}}, Acc) ->
+ lists:foldr(fun init_subscriber/2, Acc, apply(M, F, A));
+
init_subscriber(Other, Acc) ->
?warning("Incorrect static subscriber spec ~p. "
"Use { Reporter, Metric, DataPoint, Interval [, Extra ]}~n", [ Other ]),
|