asterisk/res/prometheus
Matt Jordan 0bb38796b7 res_prometheus: Add metrics for PJSIP outbound registrations
When monitoring Asterisk instances, it's often useful to know when an
outbound registration fails, as this often maps to the notion of a trunk
and having a trunk fail is usually a "bad thing". As such, this patch
adds monitoring metrics that track the state of PJSIP outbound registrations.
It does this by looking for the Registry events coming across the Stasis
system topic, and publishing those as metrics to Prometheus. Note that
while this may support other outbound registration types (IAX2, SIP, etc.)
those haven't been tested. Your mileage may vary.

(And why are you still using IAX2 and SIP? It's 2019 folks. Get with the
program.)

This patch also adds Sorcery observers to handle modifications to the
underlying PJSIP outbound registration objects. This is useful when a
reload is triggered that modifies the properties of an outbound registration,
or when ARI push configuration is used and an object is updated or
deleted. Because we rely on properties of the registration object to
define the metric (label key/value pairs), we delete the relevant metric when
we notice that something has changed and wait for a new Stasis message to
arrive to re-create the metric.

ASTERISK-28403

Change-Id: If01420e38530fc20b6dd4aa15cd281d94cd2b87e
2019-05-22 08:25:19 -05:00
..
bridges.c res_prometheus: Add CLI commands 2019-05-22 08:24:39 -05:00
channels.c res_prometheus: Add Asterisk channel metrics 2019-05-21 11:03:13 -05:00
cli.c res_prometheus: Add CLI commands 2019-05-22 08:24:39 -05:00
endpoints.c res_prometheus: Add CLI commands 2019-05-22 08:24:39 -05:00
pjsip_outbound_registrations.c res_prometheus: Add metrics for PJSIP outbound registrations 2019-05-22 08:25:19 -05:00
prometheus_internal.h res_prometheus: Add metrics for PJSIP outbound registrations 2019-05-22 08:25:19 -05:00