pub fn gen_report(values: HashMap<String, i32>) -> Result<String>
Expand description
Generate a Prometheus compatible report. Output should follow the instrumentation guidelines.
In short form, the file should be a plain text output, with each metric on it’s own line using the following format:
# HELP metric_name Optional description of this metric
# TYPE metric_name {required type (gauge|count|histogram|summary)}
metric_name{label="label1"} value
metric_name{label="label2"} value
An example which would return counts of messages in given states at the current time would be:
# HELP autopush_reliability Counts for messages in given states
# TYPE metric_name gauge
autopush_reliability{state="recv"} 123
autopush_reliability{state="stor"} 123
# EOF
Note that time is not required. A timestamp has been added to the output, but is ignored by Prometheus, and is only provided to ensure that there is no intermediate caching occurring.
The report endpoint currently is only provided by autoendpoint
, even though the report
is inclusive for all push milestones. This is done for simplicity, both for serving the
data and for collection and management of the metrics.