Prometheus metrics

Has anyone done any Prometheus metrics from the thinlinc environment? I would like to monitor number of logged in users and other metrics.

Only thing found when googling was a link to a dead bugzilla: https://bugzilla.cendio.com/show_bug.cgi?id=7848

Hi @eric,

Unfortunately we’ve had to disable external bugzilla access temporarily due to a DoS attack.

The bug you linked is about making the output of tlctl stable/parsable so that it can be used in scripts. Prometheus is mentioned as an example.

You could still try parsing the output of tlctl, but just be aware that it may change in future updates. Otherwise, you may be able to do something using /var/log/thinlinc-user-licenses, or counting the number of Xvnc processes.

Hope that helps.

thanks, yes, I choose to use mtail with this thinlinc.mtail:

# Declare the gauge metrics
gauge valid_user_licenses_total
gauge unique_users_running_total
gauge running_sessions_total
gauge licenses_in_use_total

# Match the log line and assign values to gauges
/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}) Valid user licenses: (\d+)\. (\d+) unique users currently running (\d+) sessions using (\d+) licenses$/ {
    valid_user_licenses_total = $2
    unique_users_running_total = $3
    running_sessions_total = $4
    licenses_in_use_total = $5
}

And then I start the mtail:

./mtail --v 2 --progs ./thinlinc.mtail --logs /var/log/thinlinc-user-licenses --port 3903

1 Like

Great! Thanks for posting your solution, hopefully it will help others.

I was wondering if we could put together a kind of inventory of the metrics that are currently possible to extract from ThinLinc with the existing tools (logs, tlctl, mtail, process monitoring, etc.).

It would be really helpful to see what others are already tracking, and I think it could also help newcomers who want to start monitoring. Would you help?