Commit Graph

5 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther a1b372441f res_prometheus: Do not crash on invisible bridges
Avoid crashing by skipping invisible bridges and checking the
snapshot for a null pointer. In effect this is how the bridges
are enumerated in res/ari/resource_bridges.c already.

ASTERISK-30239
ASTERISK-30237

Change-Id: I58ef9f44036feded5966b5fc70ae754f8182883d
2022-09-26 19:28:40 -05:00
Alexander Traud 178cb0ffe4 res: Fix for Doxygen.
These are the remaining issues found in /res.

ASTERISK-29761

Change-Id: I572e6019c422780dde5ce8448b6c85c77af6046d
2021-12-03 12:12:02 -06:00
George Joseph 19eef2a6dc res_prometheus: Clone containers before iterating
The channels, bridges and endpoints scrape functions were
grabbing their respective global containers, getting the
count of entries, allocating metric arrays based on
that count, then iterating over the container.  If the
global container had new objects added after the count
was taken and the metric arrays were allocated, we'd run
out of metric entries and attempt to write past the end
of the arrays.

Now each of the scape functions clone their respective
global containers and all operations are done on the
clone.  Since the clone is stable between getting the
count and iterating over it, we can't run past the end
of the metrics array.

ASTERISK-29130
Reported-By: Francisco Correia
Reported-By: BJ Weschke
Reported-By: Sébastien Duthil

Change-Id: If0c8e40853bc0e9429f2ba9c7f5f358d90c311af
2021-04-02 07:38:57 -05:00
Matt Jordan a2648b22eb res_prometheus: Add CLI commands
This patch adds a few CLI commands to the res_prometheus module to aid
system administrators setting up and configuring the module. This includes:

* prometheus show status: Display basic statistics about the Prometheus
  module, including its essential configuration, when it was last scraped,
  and how long the scrape took. The last two bits of information are useful
  when Prometheus isn't generating metrics appropriately, as it will at
  least tell you if Asterisk has had its HTTP route hit by the remote
  server.

* prometheus show metrics: Dump the current metrics to the CLI. Useful for
  system administrators to see what metrics are currently available without
  having to cURL or go to Prometheus itself.

ASTERISK-28403

Change-Id: Ic09813e5e14b901571c5c96ebeae2a02566c5172
2019-05-22 08:24:39 -05:00
Matt Jordan 066280f0cc res_prometheus: Add Asterisk bridge metrics
This patch adds basic Asterisk bridge statistics to the res_prometheus
module. This includes:

* asterisk_bridges_count: The current number of bridges active on the
  system.

* asterisk_bridges_channels_count: The number of channels active in a
  bridge.

In all cases, enough information is provided with each bridge metric
to determine a unique instance of Asterisk that provided the data, along
with the technology, subclass, and creator of the bridge.

ASTERISK-28403

Change-Id: Ie27417dd72c5bc7624eb2a7a6a8829d7551788dc
2019-05-21 21:43:02 -05:00