Asterisk - The Open Source Telephony Project
18.5.0
|
Prometheus Channel Metrics. More...
#include "asterisk.h"
#include "asterisk/res_prometheus.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/pbx.h"
#include "prometheus_internal.h"
Go to the source code of this file.
Data Structures | |
struct | channel_metric_defs |
Macros | |
#define | CHANNELS_DURATION_HELP "Individual channel durations (in seconds)." |
#define | CHANNELS_STATE_HELP "Individual channel states. 0=down; 1=reserved; 2=offhook; 3=dialing; 4=ring; 5=ringing; 6=up; 7=busy; 8=dialing_offhook; 9=prering." |
Functions | |
int | channel_metrics_init (void) |
Initialize channel metrics. More... | |
static void | channel_metrics_unload_cb (void) |
static void | channels_scrape_cb (struct ast_str **response) |
static void | get_channel_duration (struct prometheus_metric *metric, struct ast_channel_snapshot *snapshot) |
static void | get_channel_state (struct prometheus_metric *metric, struct ast_channel_snapshot *snapshot) |
static void | get_current_call_count (struct prometheus_metric *metric) |
static void | get_total_call_count (struct prometheus_metric *metric) |
Variables | |
struct channel_metric_defs | channel_metric_defs [] |
struct prometheus_callback | channels_callback |
static struct prometheus_metric | global_channel_metrics [] |
static struct prometheus_metrics_provider | provider |
Prometheus Channel Metrics.
Definition in file channels.c.
Definition at line 36 of file channels.c.
#define CHANNELS_STATE_HELP "Individual channel states. 0=down; 1=reserved; 2=offhook; 3=dialing; 4=ring; 5=ringing; 6=up; 7=busy; 8=dialing_offhook; 9=prering." |
Definition at line 34 of file channels.c.
int channel_metrics_init | ( | void | ) |
Initialize channel metrics.
0 | success |
-1 | error |
Definition at line 241 of file channels.c.
References prometheus_callback_register(), and prometheus_metrics_provider_register().
Referenced by load_module().
|
static |
Definition at line 227 of file channels.c.
References prometheus_callback_unregister().
|
static |
Definition at line 130 of file channels.c.
References ao2_container_clone, ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ARRAY_LEN, ast_calloc, ast_channel_cache_all(), ast_copy_string(), ast_eid_default, ast_eid_to_str(), ast_free, AST_LIST_INSERT_TAIL, ast_channel_snapshot::base, channel_cache, channels, prometheus_metric::children, prometheus_metric::get_metric_value, channel_metric_defs::get_value, channel_metric_defs::help, prometheus_metric::help, ast_channel_snapshot_peer::linkedid, channel_metric_defs::name, ast_channel_snapshot_base::name, NULL, ast_channel_snapshot::peer, PROMETHEUS_METRIC_GAUGE, PROMETHEUS_METRIC_SET_LABEL, PROMETHEUS_METRIC_STATIC_INITIALIZATION, prometheus_metric_to_string(), ast_channel_snapshot_base::type, prometheus_metric::type, ast_channel_snapshot_base::uniqueid, and prometheus_metric::value.
|
static |
Definition at line 57 of file channels.c.
References ast_tvdiff_sec(), ast_tvnow(), ast_channel_snapshot::base, ast_channel_snapshot_base::creationtime, and prometheus_metric::value.
|
static |
Definition at line 45 of file channels.c.
References ast_channel_snapshot::state, and prometheus_metric::value.
|
static |
Definition at line 100 of file channels.c.
References ast_active_calls(), and prometheus_metric::value.
|
static |
Definition at line 95 of file channels.c.
References ast_processed_calls(), and prometheus_metric::value.
struct channel_metric_defs channel_metric_defs[] |
struct prometheus_callback channels_callback |
Definition at line 218 of file channels.c.
|
static |
Definition at line 109 of file channels.c.
|
static |
Definition at line 236 of file channels.c.