res_prometheus: Add Asterisk channel metrics

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

* asterisk_calls_sum: A running sum of the total number of
  processed calls

* asterisk_calls_count: The current number of calls

* asterisk_channels_count: The current number of channels

* asterisk_channels_state: The state of any particular channel

* asterisk_channels_duration_seconds: How long a channel has existed,
  in seconds

In all cases, enough information is provided with each channel metric
to determine a unique instance of Asterisk that provided the data, as
well as the name, type, unique ID, and - if present - linked ID of each
channel.

ASTERISK-28403

Change-Id: I0db306ec94205d4f58d1e7fbabfe04b185869f59
This commit is contained in:
Matt Jordan
2019-05-02 19:45:27 -05:00
parent 54f7f7dc20
commit 0760af71ad
7 changed files with 371 additions and 11 deletions

View File

@@ -3,12 +3,9 @@
;
;
; Note that this configuration file is consumed by res_prometheus, which
; provides core functionality for serving up Asterisk statistics to a
; Prometheus server. By default, this only includes basic information about
; the Asterisk instance that is running. Additional modules can be loaded to
; provide specific statistics. In all cases, configuration of said statistics
; is done through this configuration file.
; This configuration file is consumed by res_prometheus, which
; provides the functionality for serving up Asterisk statistics to a
; Prometheus server.
;
; Because Prometheus scrapes statistics from HTTP servers, this module requires
; Asterisk's built-in HTTP server to be enabled and configured properly.