Asterisk - The Open Source Telephony Project
18.5.0
|
Prometheus PJSIP Outbound Registration Metrics. More...
#include "asterisk.h"
#include "asterisk/stasis_message_router.h"
#include "asterisk/stasis_system.h"
#include "asterisk/res_prometheus.h"
#include "asterisk/res_pjsip.h"
#include "prometheus_internal.h"
Go to the source code of this file.
Data Structures | |
struct | prometheus_metric_wrapper |
Functions | |
static | AST_VECTOR (struct prometheus_metric_wrapper *) |
static struct prometheus_metric_wrapper * | get_wrapper (const char *key) |
int | pjsip_outbound_registration_metrics_init (void) |
Initialize PJSIP outbound registration metrics. More... | |
static void | pjsip_outbound_registration_metrics_unload_cb (void) |
static void | registration_deleted_observer (const void *obj) |
static void | registration_loaded_observer (const char *name, const struct ast_sorcery *sorcery, const char *object_type, int reloaded) |
static int | registration_state_to_int (const char *state) |
static void | registry_message_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
Variables | |
static ast_mutex_t | metrics_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
static const struct ast_sorcery_instance_observer | observer_callbacks_registrations |
static struct prometheus_metrics_provider | provider |
static const struct ast_sorcery_observer | registration_observer |
static struct stasis_message_router * | router |
Prometheus PJSIP Outbound Registration Metrics.
Definition in file pjsip_outbound_registrations.c.
|
static |
Definition at line 78 of file pjsip_outbound_registrations.c.
References ast_calloc, ast_copy_string(), prometheus_metric_wrapper::key, and NULL.
|
static |
Definition at line 111 of file pjsip_outbound_registrations.c.
References AST_VECTOR_GET, AST_VECTOR_SIZE, prometheus_metric_wrapper::key, lock, metrics_lock, NULL, and SCOPED_MUTEX.
Referenced by registry_message_cb().
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, prometheus_metrics_provider_register(), registry_message_cb(), stasis_message_router_add(), and stasis_message_router_create.
Referenced by load_module().
|
static |
Definition at line 323 of file pjsip_outbound_registrations.c.
References ast_sip_get_sorcery(), ast_sorcery_instance_observer_remove(), ast_sorcery_observer_remove(), NULL, and stasis_message_router_unsubscribe_and_join().
|
static |
Definition at line 151 of file pjsip_outbound_registrations.c.
References ast_debug, ast_free, ast_sip_get_sorcery(), ast_sorcery_objectset_create, ast_variables_destroy(), AST_VECTOR_GET, AST_VECTOR_REMOVE, AST_VECTOR_SIZE, prometheus_metric_wrapper::key, lock, prometheus_metric_wrapper::metric, metrics_lock, ast_variable::name, ast_variable::next, prometheus_metric_unregister(), SCOPED_MUTEX, and ast_variable::value.
|
static |
Definition at line 212 of file pjsip_outbound_registrations.c.
References ao2_ref, ast_debug, ast_free, AST_RETRIEVE_FLAG_DEFAULT, ast_sip_get_sorcery(), ast_sorcery_retrieve_by_fields(), AST_VECTOR_GET, AST_VECTOR_REMOVE, AST_VECTOR_SIZE, prometheus_metric_wrapper::key, lock, prometheus_metric_wrapper::metric, metrics_lock, ast_variable::name, NULL, prometheus_metric_unregister(), and SCOPED_MUTEX.
|
static |
Definition at line 135 of file pjsip_outbound_registrations.c.
Referenced by registry_message_cb().
|
static |
Definition at line 267 of file pjsip_outbound_registrations.c.
References ast_eid_default, ast_eid_to_str(), ast_free, ast_json_object_get(), ast_json_string_get(), ast_mutex_lock, ast_mutex_unlock, AST_VECTOR_APPEND, channel_type, get_wrapper(), prometheus_metric::help, ast_json_payload::json, prometheus_metric::lock, prometheus_metric_wrapper::metric, prometheus_metric::name, NULL, prometheus_gauge_create(), PROMETHEUS_METRIC_GAUGE, prometheus_metric_register(), PROMETHEUS_METRIC_SET_LABEL, PROMETHEUS_METRIC_STATIC_INITIALIZATION, registration_state_to_int(), stasis_message_data(), and prometheus_metric::value.
Referenced by pjsip_outbound_registration_metrics_init().
|
static |
Definition at line 67 of file pjsip_outbound_registrations.c.
Referenced by get_wrapper(), registration_deleted_observer(), and registration_loaded_observer().
|
static |
Definition at line 251 of file pjsip_outbound_registrations.c.
|
static |
Definition at line 337 of file pjsip_outbound_registrations.c.
|
static |
Definition at line 191 of file pjsip_outbound_registrations.c.
|
static |
Definition at line 42 of file pjsip_outbound_registrations.c.
Referenced by cdr_prop_write(), cdr_read(), cdr_write(), forkcdr_exec(), load_module(), publish_app_cdr_message(), router_dispatch(), router_dtor(), stasis_message_router_create_internal(), and unload_module().