res_prometheus: Add Asterisk endpoint metrics

This patch adds basic Asterisk endpoint statistics to the res_prometheus
module. This includes:

* asterisk_endpoints_state: The current state (unknown, online, offline)
  for each defined endpoint.

* asterisk_endpoints_channels_count: The current number of channels
  associated with a given endpoint.

* asterisk_endpoints_count: The current number of defined endpoints.

In all cases, enough information is provided with each endpoint metric
to determine a unique instance of Asterisk that provided the data, as well
as the underlying technology and resource definition.

ASTERISK-28403

Change-Id: I46443963330c206a7d12722d08dcaabef672310e
This commit is contained in:
Matt Jordan
2019-05-09 09:41:02 -05:00
parent 0760af71ad
commit ed6cd13b5b
3 changed files with 205 additions and 1 deletions

View File

@@ -917,7 +917,7 @@ static int load_module(void)
goto cleanup;
}
if (channel_metrics_init()) {
if (channel_metrics_init() || endpoint_metrics_init()) {
goto cleanup;
}