Skip to content
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

Monitoring of Backends #182

Closed
pyte1 opened this issue Jan 7, 2022 · 9 comments
Closed

Monitoring of Backends #182

pyte1 opened this issue Jan 7, 2022 · 9 comments

Comments

@pyte1
Copy link

pyte1 commented Jan 7, 2022

Hi,

i trying to find a way to monitor the connections/users on each backend that i defined in the servers.conf. I tried to do it with some scripting and analysing the output but with no great luck. Is there any easy way to messure the current connection/user count for a specific backend or all backends overall?

@fancycode
Copy link
Member

The signaling server (and -proxy) have a /metrics endpoint that provide data that can be imported in Prometheus / Grafana. Unfortunately this is still lacking documentation but you should get some data by loading http://<signaling-ip>:<signaling-port>/metrics.

@pyte1
Copy link
Author

pyte1 commented Jan 10, 2022

Thank you for your reply.

Is there any configuration needed for this to work? As it does not seem to work OOB

@fancycode
Copy link
Member

This should be working out-of-the box with 0.4.0 and newer for clients connecting from whitelisted IP addresses (127.0.0.1 by default):

@fancycode
Copy link
Member

Example from my local dev setup:

[...]
# HELP signaling_hub_rooms The current number of rooms per backend
# TYPE signaling_hub_rooms gauge
signaling_hub_rooms{backend="compat"} 1
# HELP signaling_hub_sessions The current number of sessions per backend
# TYPE signaling_hub_sessions gauge
signaling_hub_sessions{backend="compat",clienttype="client"} 1
[...]

@pyte1
Copy link
Author

pyte1 commented Jan 10, 2022

Yep i've got it. I guess "signaling_hub_rooms" and "signaling_hub_sessions" gets only displayed if there are any?

Right now i only see:

# HELP signaling_backend_current The current number of configured backends
# TYPE signaling_backend_current gauge
signaling_backend_current 1
# HELP signaling_hub_sessions_resume_failed_total The total number of failed session resume requests
# TYPE signaling_hub_sessions_resume_failed_total counter
signaling_hub_sessions_resume_failed_total 0

But there is no one using it right now.

@fancycode
Copy link
Member

Yeah, some values only get created once the corresponding entry is used, i.e. a backend gets sessions / rooms or a room has sessions, e.g.:

# HELP signaling_room_sessions The current number of sessions in a room
# TYPE signaling_room_sessions gauge
signaling_room_sessions{backend="compat",clienttype="client",room="abcdefgh"} 1

This is because the metrics subsystem doesn't know about all possible values and it doesn't make sense to have all potential values in the output all the time, e.g. the sessions per room as shown above. Once the number of sessions in a room reach zero, the value is no longer returned.

@pyte1
Copy link
Author

pyte1 commented Jan 10, 2022

Thank you! :) May i find some time to contribute to this project and document at least some bits regarding the metrics. Cheers!

@cari-coders
Copy link

The signaling server (and -proxy) have a /metrics endpoint that provide data that can be imported in Prometheus / Grafana. Unfortunately this is still lacking documentation but you should get some data by loading http://<signaling-ip>:<signaling-port>/metrics.

I am getting an "authentication check failed" reply. Which headers must i include in the request? And can I find documentation about it somewhere?

@fancycode
Copy link
Member

The metrics are documented here:
https://github.com/strukturag/nextcloud-spreed-signaling/blob/master/docs/prometheus-metrics.md

Authentication is IP-based and must be configured in the server.conf:

[stats]
# Comma-separated list of IP addresses that are allowed to access the stats
# endpoint. Leave empty (or commented) to only allow access from "127.0.0.1".
#allowed_ips =

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants