-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add metric to show participants by origin servername #65
Conversation
This looks interesting. I see that on my BBB server (with Greenlight) I also get the metadata: <bbb-origin>Greenlight</bbb-origin> Is this in your case with 2 Greenlight's the same for both? |
bbb-exporter/collector.py
Outdated
if participants == 0: | ||
continue | ||
if not meeting.get("metadata") or not meeting['metadata'].get(metadata_key): | ||
p_by_m['_no_metadata'] += participants |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add to the empty key instead of the magic key _no_metadata
:
p_by_m[''] += participants
This way the Prometheus library should generate an empty label, which is more semantically correct than a hardcoded magic string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I thought about that and decided against; I am happy with you voting for it and changed it accordingly :)
Yep, only the origin is set. I only went for this metadata key because greenlight is already doing it. I wonder, if this metric is useful for the general public, as I don't know how many people are using a bigbluebutton instance with more than just 1 greenlight... From the semantics at least, |
I just checked another BBB server where we are using the Moodle plugin to integrate BBB into subjects. There are a couple more metdata fields, but the two we're interested in <bbb-origin>Moodle</bbb-origin> Let's make this a bit more generic and add the two metadata fields into a single metric. I propose something like this:
|
Should it not be |
Perfect, this is the expected behavior: https://prometheus.io/docs/concepts/data_model/
You are probably right. Let's do the plural version. |
Okay, so be it. Any more wishes? I tested the latest commit as well in my setup, works :-) |
Looks great, thanks! Creating tests would be great, but the time it would take to mock BBB's API was never justified with my schedule :P I'll merge this in the v0.6 release branch and also add a couple of panels to the Grafana dashboard. Once it's ready and running a couple of days in my BBB environment I'll make a new release. |
Greenlight sets a metadata field called
bbb-origin-server-name
with the server name of the greenlight instance.I administrate a BBB server which has two greenlights and a custom application as users. I would like to see an approximate distribution of where clients are coming from.
This adds this metric as
bbb_meetings_participant_origin_servername
with the servername in theorigin
field. Meetings with participants without the metadata field set get added to a_no_metadata
group:bbb_meetings_participant_origin_servername{origin="_no_metadata"}