Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Prometheus Metric Internal API. More...
Go to the source code of this file.
Functions | |
int | bridge_metrics_init (void) |
Initialize bridge metrics. More... | |
int | channel_metrics_init (void) |
Initialize channel metrics. More... | |
int | cli_init (void) |
Initialize CLI command. More... | |
int | endpoint_metrics_init (void) |
Initialize endpoint metrics. More... | |
int | pjsip_outbound_registration_metrics_init (void) |
Initialize PJSIP outbound registration metrics. More... | |
int64_t | prometheus_last_scrape_duration_get (void) |
Retrieve the amount of time it took to perform the last scrape. More... | |
struct timeval | prometheus_last_scrape_time_get (void) |
Retrieve the timestamp when the last scrape occurred. More... | |
struct ast_str * | prometheus_scrape_to_string (void) |
Get the raw output of what a scrape would produce. More... | |
Prometheus Metric Internal API.
This module provides internal APIs for res_prometheus. It should not be used outsize of that module, and should typically only provide intialization functions for units that want to register metrics / handlers with the core API.
Definition in file prometheus_internal.h.
int bridge_metrics_init | ( | void | ) |
Initialize bridge metrics.
0 | success |
-1 | error |
Definition at line 206 of file bridges.c.
References bridges_callback, prometheus_callback_register(), prometheus_metrics_provider_register(), and provider.
Referenced by load_module().
int channel_metrics_init | ( | void | ) |
Initialize channel metrics.
0 | success |
-1 | error |
Definition at line 241 of file channels.c.
References channels_callback, prometheus_callback_register(), prometheus_metrics_provider_register(), and provider.
Referenced by load_module().
int cli_init | ( | void | ) |
Initialize CLI command.
0 | success |
-1 | error |
Definition at line 137 of file res/prometheus/cli.c.
References ARRAY_LEN, ast_cli_register_multiple, cli_prometheus, prometheus_metrics_provider_register(), and provider.
Referenced by load_module().
int endpoint_metrics_init | ( | void | ) |
Initialize endpoint metrics.
0 | success |
-1 | error |
Definition at line 198 of file res/prometheus/endpoints.c.
References endpoints_callback, prometheus_callback_register(), prometheus_metrics_provider_register(), and provider.
Referenced by load_module().
int pjsip_outbound_registration_metrics_init | ( | void | ) |
Initialize PJSIP outbound registration metrics.
0 | success |
-1 | error |
Definition at line 342 of file pjsip_outbound_registrations.c.
References ao2_cleanup, ast_sip_get_sorcery(), ast_sorcery_instance_observer_add(), ast_sorcery_instance_observer_remove(), ast_sorcery_observer_add(), ast_sorcery_observer_remove(), ast_system_registry_type(), ast_system_topic(), cleanup(), NULL, observer_callbacks_registrations, prometheus_metrics_provider_register(), provider, registration_observer, router, stasis_message_router_add(), and stasis_message_router_create.
Referenced by load_module().
int64_t prometheus_last_scrape_duration_get | ( | void | ) |
Retrieve the amount of time it took to perform the last scrape.
Time returned is in milliseconds
The | scrape duration, in milliseconds |
Definition at line 701 of file res_prometheus.c.
References core_scrape_metric, and prometheus_metric::value.
Referenced by prometheus_show_status().
struct timeval prometheus_last_scrape_time_get | ( | void | ) |
Retrieve the timestamp when the last scrape occurred.
The | time when the last scrape occurred |
Definition at line 712 of file res_prometheus.c.
References last_scrape, lock, SCOPED_MUTEX, and scrape_lock.
Referenced by prometheus_show_status().
struct ast_str * prometheus_scrape_to_string | ( | void | ) |
Get the raw output of what a scrape would produce.
It can be useful to dump what a scrape will look like. This function returns the raw string representation of the metrics.
NULL | on error |
Malloc'd | ast_str on success |
Definition at line 685 of file res_prometheus.c.
References ast_mutex_lock, ast_mutex_unlock, ast_str_create, NULL, scrape_lock, and scrape_metrics().
Referenced by AST_TEST_DEFINE(), and prometheus_show_metrics().