jsclayton / prometheus-plex-exporter

Export metrics from your Plex Media Server
GNU Affero General Public License v3.0
117 stars 13 forks source link

Active streaming users #14

Open Kybeer opened 1 year ago

Kybeer commented 1 year ago

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.

Animosity022 commented 11 months ago

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

Kybeer commented 11 months ago

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?

Animosity022 commented 11 months ago

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).

Kybeer commented 10 months ago

Nice, it's perfect!