prometheus-plex-exporter icon indicating copy to clipboard operation
prometheus-plex-exporter copied to clipboard

Active streaming users

Open Kybeer opened this issue 2 years ago • 4 comments

Hi, Is there any way to get the current active users from the available metrics? I was thinking with 'plays_total' but I'm unsure for to transform the result in an actual Grafana panel.

Kybeer avatar Jul 04 '23 19:07 Kybeer

That's the same thing I was looking for as I was trying to replace Varken and stumbled here.

I've started playing around with it and it does produce the stats in plays_total, but I need to figure out how to remove the dupes for the query range.

I'll see what I can figure out as it looks like the data is there, but it does depend on the scrape interval so there is some lag, but seems promising:

image

animosity022 avatar Oct 17 '23 14:10 animosity022

I've started playing around with it and it does produce the stats in plays_total, but I need to figure out how to remove the dupes for the query range.

Nice, could you share the PromQL query?

Kybeer avatar Oct 17 '23 19:10 Kybeer

I think I'm closer as I almost like this:

Instant seems to grab the 'latest:

image

and I used a transform to rename/hide some stuff:

image

image

Not sure if that's the best but seems to do what I want (I think).

animosity022 avatar Oct 17 '23 20:10 animosity022

Nice, it's perfect!

Kybeer avatar Oct 21 '23 12:10 Kybeer