Asterisk - The Open Source Telephony Project
18.5.0
|
Defines a callback that will be invoked when the HTTP route is called. More...
#include <res_prometheus.h>
Data Fields | |
void(* | callback_fn )(struct ast_str **output) |
The callback function to invoke. More... | |
const char * | name |
The name of our callback (always useful for debugging) More... | |
Defines a callback that will be invoked when the HTTP route is called.
This callback presents the second way of passing metrics to a Prometheus server. For metrics that are generated often or whose value needs to be stored, metrics can be created and registered. For metrics that can be obtained "on-the-fly", this mechanism is preferred. When the HTTP route is queried by promtheus, the registered callbacks are invoked. The string passed to the callback should be populated with stack-allocated metrics using prometheus_metric_to_string
.
Example Usage:
Definition at line 413 of file res_prometheus.h.
void(* callback_fn) (struct ast_str **output) |
The callback function to invoke.
Definition at line 421 of file res_prometheus.h.
Referenced by prometheus_callback_register(), and scrape_metrics().
const char* name |
The name of our callback (always useful for debugging)
Definition at line 417 of file res_prometheus.h.
Referenced by AST_TEST_DEFINE(), PathSegment::get_child(), Parameter::load(), SwaggerType::load(), Property::load(), prometheus_callback_register(), and prometheus_callback_unregister().