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
This commit is contained in:
Matt Jordan
2019-01-03 10:28:28 -06:00
parent 066280f0cc
commit a2648b22eb
5 changed files with 253 additions and 22 deletions

View File

@@ -145,7 +145,6 @@ static void bridges_scrape_cb(struct ast_str **response)
prometheus_metric_to_string(&bridge_metrics[j], response);
}
ast_free(bridge_metrics);
ao2_ref(bridges, -1);
}