Asterisk - The Open Source Telephony Project  21.4.1
Data Structures | Macros | Functions | Variables
res/prometheus/endpoints.c File Reference

Prometheus Endpoint Metrics. More...

#include "asterisk.h"
#include "asterisk/stasis_endpoints.h"
#include "asterisk/res_prometheus.h"
#include "prometheus_internal.h"

Go to the source code of this file.

Data Structures

struct  endpoint_metric_defs
 

Macros

#define ENDPOINTS_CHANNELS_COUNT_HELP   "Count of the number of channels currently existing that are associated with the endpoint."
 
#define ENDPOINTS_STATE_HELP   "Individual endpoint states. 0=unknown; 1=offline; 2=online."
 

Functions

int endpoint_metrics_init (void)
 Initialize endpoint metrics. More...
 
static void endpoint_metrics_unload_cb (void)
 
static void endpoints_scrape_cb (struct ast_str **response)
 
static void get_endpoint_channel_count (struct prometheus_metric *metric, struct ast_endpoint_snapshot *snapshot)
 
static void get_endpoint_state (struct prometheus_metric *metric, struct ast_endpoint_snapshot *snapshot)
 

Variables

struct endpoint_metric_defs endpoint_metric_defs []
 
struct prometheus_callback endpoints_callback
 
static struct prometheus_metrics_provider provider
 

Detailed Description

Prometheus Endpoint Metrics.

Author
Matt Jordan mjord.nosp@m.an@d.nosp@m.igium.nosp@m..com

Definition in file res/prometheus/endpoints.c.

Function Documentation

int endpoint_metrics_init ( void  )

Initialize endpoint metrics.

Return values
0success
-1error

Definition at line 198 of file res/prometheus/endpoints.c.

References prometheus_callback_register(), and prometheus_metrics_provider_register().

199 {
201  prometheus_callback_register(&endpoints_callback);
202 
203  return 0;
204 }
int prometheus_callback_register(struct prometheus_callback *callback)
void prometheus_metrics_provider_register(const struct prometheus_metrics_provider *provider)
Register a metrics provider.

Variable Documentation

struct prometheus_callback endpoints_callback
Initial value:
= {
.name = "Endpoints callback",
.callback_fn = endpoints_scrape_cb,
}

Definition at line 175 of file res/prometheus/endpoints.c.

struct prometheus_metrics_provider provider
static
Initial value:
= {
.name = "endpoints",
.unload_cb = endpoint_metrics_unload_cb,
}

Definition at line 193 of file res/prometheus/endpoints.c.