Skip to content

Commit

Permalink
fix: bbb version metric
Browse files Browse the repository at this point in the history
  • Loading branch information
greenstatic committed Mar 24, 2024
1 parent 3406cdd commit 73920e5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
11 changes: 7 additions & 4 deletions bbb-exporter/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ def collect(self):
yield self.metric_unique_breakout_rooms_count(meetings)

if self.bbb_version_from_disk:
self.metric_bbb_version()
bbb_version = self.metric_bbb_version()
if bbb_version:
yield bbb_version

bbb_exporter = GaugeMetricFamily("bbb_exporter", "BigBlueButton Exporter version", labels=["version"])
bbb_exporter.add_metric([settings.VERSION], 1)
Expand Down Expand Up @@ -334,9 +336,10 @@ def metric_unique_breakout_rooms_count(self, meetings):
def metric_bbb_version(self):
with open("/etc/bigbluebutton/bigbluebutton-release", "r") as f:
bbb_release = f.read()
bbb_version = GaugeMetricFamily("bbb_version", "BigBlueButton version", labels=["version"])
bbb_version.add_metric([bbb_release.strip().split("=")[1]], 1)
yield bbb_version
metric = GaugeMetricFamily("bbb_version", "BigBlueButton version", labels=["version"])
metric.add_metric([bbb_release.strip().split("=")[1]], 1)
return metric
return None

@staticmethod
def _get_participant_count_by_client(meetings):
Expand Down
2 changes: 1 addition & 1 deletion bbb-exporter/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
MAJOR = 0
MINOR = 7
BUGFIX = 0
INFO = "preview3"
INFO = ""

VERSION = "{}.{}.{}".format(MAJOR, MINOR, BUGFIX)
if INFO:
Expand Down
14 changes: 13 additions & 1 deletion docs/exporter-user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@
* A `CA_BUNDLE` file is normal file that contains a list of CA certificates you trust.
See [FAQ](./faq.md#my-ca_bundle-for-the-tls_verify-environment-variable-is-not-working) or the under the hood
[library documentation](https://2.python-requests.org/en/master/user/advanced/#ssl-cert-verification) for details.

* BBB_VERSION_READ_FROM_DISK - Enable the `bbb_version` metric
* Required: false
* Default: false
* Values: <true | false>
* Prerequisites: access to `/etc/bigbluebutton/bigbluebutton-release` (for Docker containers do a read-only bind mount)
so running the exporter remotely with this option is not possible (unless you setup a remote file mount).
* The metric `bbb_version` relies on this option to be turned on

# Optimizations
* RECORDINGS_METRICS_READ_FROM_DISK - Collect expensive recordings metrics by querying the disk instead of the API.
This can substantially decrease the scrape time required for the exporter to respond to metrics requests.
Expand Down Expand Up @@ -93,6 +100,11 @@ the exporter to be installed on the BigBlueButton server (access to `/var/bigblu
`RECORDINGS_METRICS_READ_FROM_DISK` to be enabled
* bbb_api_up - 1 if BigBlueButton API is responding 0 otherwise
* bbb_exporter(labels: version) - Information about the exporter (i.e. version)
* bbb_version(labels: version) - BigBlueButton version, requires for `BBB_VERSION_READ_FROM_DISK` to be enabled

### Counters
* bbb_unique_meetings - Total number of unique non-breakout meetings
* bbb_unique_breakout_rooms - Total number of unique breakout rooms

### Histograms
* bbb_api_latency(labels: endpoint, parameters) - BigBlueButton API call latency
Expand Down

0 comments on commit 73920e5

Please sign in to comment.