Jump to content

Emby Metrics Exporter


Bagul

Recommended Posts

Hi everyone :)

I did a quick export of some emby metrics for prometheus. It's still a first in alpha alpha alpha alpha alpha version but it seems to work :)

If some volunteers want to try it and give me some feedback it would be really cool. I have in mind to add geoip to have a small map in grafana for example.

 

If you use docker you just have to type this command:

docker run -d -it \
   --name=emby_exporter \
   -e CONFIG_FILE=NAME_OF_YOUR_FILE.yml \
   -v '/path/to/your/config/file.yml:/config/file.yml' \
   bagul/goemby_exporter:latest

 

Config file example:

 

server:
  url: "http://<ip|domain name>"
  port: 8096
  token: "your token"
  userID: "your userID"

 

You will find your user id in the URL on your profile (on your server of course).

 

And you will just have to add the exporter in your jobs in your prometheus config.

image.thumb.png.265de508b6ad4ee87b53ad923369ac3d.png

As you can see the information is still recovered are thin but you can already make a small dashboard.
I have the number of stream in progress and a map showing me the location of my users (approximate of course ;) )
 I think to add with time the information of Ombi for example.

 

https://github.com/TOomaAh/emby_exporter_go

 

 

My Dashboard: 

Emby Dashboard-1655999358418.json

 

Edited by Bagul
  • Thanks 3
Link to comment
Share on other sites

I added several features.

  • Recovering video playback in progress
  • Display on a map the location of users
  • Recovery of alerts
  • Recovery of activities
  • Diagram to show the most used devices
  • Diagram to show the video playback method
  • Display of the general information of the server
  • Video playback history over time
  • Support Medusa (pyMedusa)
    • Calendar
    • History
  • Support Sonarr
    • Calendar
    • History

Look at my first post to get a visual of the current dashboard (I update it regularly)

 

I will share my dashboard soon

Edited by Bagul
  • Thanks 1
Link to comment
Share on other sites

  • 3 months later...
t123thomas

I have searched several forums looking for help on how to configure Emby Prometheus/Grafana I am glad I found this thread.

My server is on winodws 10 I hope it will working if I have the right guide and assistance, I just recently set up WMI-Exporter>Prometheus>Grafana for collecting my server matrix and it working fine.

My knowledge is zero as only follow few steps from youtube to get it work work.

This like the info that I need to input into Prometheus config ?

Thanks

server:
  url: "http://<ip|domain name>"
  port: 8096
  token: "your token"
  userID: "your userID"
Edited by t123thomas
Link to comment
Share on other sites

t123thomas

My Prometheus settings

 

Here is my my WMI exproter

  - job_name: "wmi_exporter"

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: ["localhost:9182"]

 

How should I set Emby_export settings

 

Edited by t123thomas
Link to comment
Share on other sites

Bagul

Hey!

So this configuration is the configuration for the exporter not for prometheus.

server:
  url: "http://<ip|domain name>"
  port: 8096
  token: "your token"
  userID: "your userID"

For the configuration I chose YAML. So you just have to make a "config.yml" file and respect the indentation.

You will find the UserID in the url on your profile page on your server

http://url/web/index.html#!/settings/profile.html?userId=xxxxxxx&serverId=xxxxxx

If you choose to create the executable and not use Docker. You just have this command to type

emby_exporter.exe -c "C:\Your\Path\config.yml" 

 

You have 2 possibilities. Either you use Docker in this case I made an image and you just have to type the command I provided in the github link by modifying the path of the configuration file.

Or you don't use docker. In this case either you install Golang (https://go.dev) and build the executable or I can build the executable for you but I can't do it now.

 

For prometheus you just have to add a job like this: 

- job_name: 'emby_exporter'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9210']

 

Link to comment
Share on other sites

t123thomas
11 hours ago, Bagul said:

Hey!

So this configuration is the configuration for the exporter not for prometheus.

server:
  url: "http://<ip|domain name>"
  port: 8096
  token: "your token"
  userID: "your userID"

For the configuration I chose YAML. So you just have to make a "config.yml" file and respect the indentation.

You will find the UserID in the url on your profile page on your server

http://url/web/index.html#!/settings/profile.html?userId=xxxxxxx&serverId=xxxxxx

If you choose to create the executable and not use Docker. You just have this command to type

emby_exporter.exe -c "C:\Your\Path\config.yml" 

 

You have 2 possibilities. Either you use Docker in this case I made an image and you just have to type the command I provided in the github link by modifying the path of the configuration file.

Or you don't use docker. In this case either you install Golang (https://go.dev) and build the executable or I can build the executable for you but I can't do it now.

 

For prometheus you just have to add a job like this: 

- job_name: 'emby_exporter'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9210']

 

@Bagul, Thanks for your support, I have no linux experience, so ducker is not a consideration, I will appreciate your generous support to build Golang script for windows.

I have included this script in Prometheus, wainting for the executable script.

Anyway, at your convinience, let me know what is next.

Thanks

- job_name: 'emby_exporter'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9210']
Edited by t123thomas
Link to comment
Share on other sites

Bagul
On 6/19/2022 at 1:00 AM, t123thomas said:

@Bagul, Thanks for your support, I have no linux experience, so ducker is not a consideration, I will appreciate your generous support to build Golang script for windows.

I have included this script in Prometheus, wainting for the executable script.

Anyway, at your convinience, let me know what is next.

Thanks

- job_name: 'emby_exporter'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9210']

Hey!
I have created the binary for 64 bits windows: https://github.com/TOomaAh/emby_exporter_go/releases/tag/1.0.0

 

If you need help to make the dashboard I am here.

 

I'll share mine if you want I just have to do it again ahah :) 

Edited by Bagul
Link to comment
Share on other sites

t123thomas
5 hours ago, Bagul said:

Hey!
I have created the binary for 64 bits windows: https://github.com/TOomaAh/emby_exporter_go/releases/tag/1.0.0

 

If you need help to make the dashboard I am here.

 

I'll share mine if you want I just have to do it again ahah :) 

Awesome I shall give it a try, thanks in a millions I will circle with progress.

Edited by t123thomas
Link to comment
Share on other sites

t123thomas
12 hours ago, t123thomas said:

Awesome I shall give it a try, thanks in a millions I will circle with progress.

Hi Bagul, how do check if the application was installed, after it runs I did not get any notifcation, I also search through windows services it wasn't found,so how do I determine where it located.

 

Thanks,

Thomas

Link to comment
Share on other sites

Bagul
6 hours ago, t123thomas said:

Hi Bagul, how do check if the application was installed, after it runs I did not get any notifcation, I also search through windows services it wasn't found,so how do I determine where it located.

 

Thanks,

Thomas

Hey!
You don't just double click on it. You have to type this command in à terminal (cmd or powershell):

On 6/18/2022 at 2:05 PM, Bagul said:

 

emby_exporter.exe -c "C:\Your\Path\config.yml" 

On Windows you can make your own service with the software: NSSM for example to avoid opening a terminal each time.

Link to comment
Share on other sites

t123thomas
2 hours ago, Bagul said:

Hey!
You don't just double click on it. You have to type this command in à terminal (cmd or powershell):

On Windows you can make your own service with the software: NSSM for example to avoid opening a terminal each time.

got you thanks

Link to comment
Share on other sites

Bagul
On 6/22/2022 at 2:02 PM, t123thomas said:

got you thanks

Hey! I just added my dashboard to the first post. I'm going to expand it but for now it has most of the information for Emby.

Link to comment
Share on other sites

  • 5 months later...
maabgivert

Thank you very much for the contribution.
The docker could not make it work, with the perfect exe.
Could you share the json with the "Device usage" graphs...?
Again, thank you so much

Link to comment
Share on other sites

14 hours ago, maabgivert said:

Thank you very much for the contribution.
The docker could not make it work, with the perfect exe.
Could you share the json with the "Device usage" graphs...?
Again, thank you so much

I added the "device type" panel. Tell me if it works for you.

Emby Dashboard-1671704094949.json

  • Thanks 1
Link to comment
Share on other sites

  • 4 weeks later...
jaycedk

@Bagul Thank you for the help yesterday :)

Your exporter really help me add more metrics to my Grafana dashboard.

I have altered some of your panels to fit my needs.

Skærmbillede 2023-01-15 173646.png

  • Like 2
Link to comment
Share on other sites

maabgivert
32 minutes ago, jaycedk said:

@Bagul Thank you for the help yesterday :)

Your exporter really help me add more metrics to my Grafana dashboard.

I have altered some of your panels to fit my needs.

Skærmbillede 2023-01-15 173646.png

Hello, I am not very clear with grafana.  How did you get the igpu graph?  in the streams, how do you put the yellow and red lines?  Thank you.

Link to comment
Share on other sites

jaycedk
12 minutes ago, maabgivert said:

Hello, I am not very clear with grafana.  How did you get the igpu graph?  in the streams, how do you put the yellow and red lines?  Thank you.

I'm running all this on a Unraid server, I have installed a Intel iGPU metrics exporter that sends data to telegraf, telegraf is then imported into Grafana.

Where I have edited the dashboard to show that.

To add the lines is to simply edit the panel you want.

look under Thresholds and set them to your desired value.

Here are some how tos https://www.google.com/search?q=how+to+edit+panel+grafana&client=firefox-b-d&sxsrf=AJOqlzUSUGtC4SuDbsilHT-MNvwVlkGHng%3A1673804397739&ei=bTrEY8LlLIe9xc8PsuCj6AM&ved=0ahUKEwiC0LOkj8r8AhWHXvEDHTLwCD0Q4dUDCA4&uact=5&oq=how+to+edit+panel+grafana&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQAzIECAAQHjIGCAAQCBAeMgYIABAIEB46CggAEEcQ1gQQsAM6BwgjELACECc6CAgAEAcQHhATOgoIABAIEAcQHhATOg0IABAFEB4Q8QQQDRATOgoIABAIEB4QDRATOgYIABAHEB46CAgAEAgQBxAeSgQIQRgASgQIRhgAUKwIWNAVYKcZaAFwAXgAgAFkiAHeBJIBAzYuMZgBAKABAcgBCMABAQ&sclient=gws-wiz-serp

  • Thanks 1
Link to comment
Share on other sites

maabgivert
58 minutes ago, jaycedk said:

I'm running all this on a Unraid server, I have installed a Intel iGPU metrics exporter that sends data to telegraf, telegraf is then imported into Grafana.

Where I have edited the dashboard to show that.

To add the lines is to simply edit the panel you want.

look under Thresholds and set them to your desired value.

Here are some how tos https://www.google.com/search?q=how+to+edit+panel+grafana&client=firefox-b-d&sxsrf=AJOqlzUSUGtC4SuDbsilHT-MNvwVlkGHng%3A1673804397739&ei=bTrEY8LlLIe9xc8PsuCj6AM&ved=0ahUKEwiC0LOkj8r8AhWHXvEDHTLwCD0Q4dUDCA4&uact=5&oq=how+to+edit+panel+grafana&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQAzIECAAQHjIGCAAQCBAeMgYIABAIEB46CggAEEcQ1gQQsAM6BwgjELACECc6CAgAEAcQHhATOgoIABAIEAcQHhATOg0IABAFEB4Q8QQQDRATOgoIABAIEB4QDRATOgYIABAHEB46CAgAEAgQBxAeSgQIQRgASgQIRhgAUKwIWNAVYKcZaAFwAXgAgAFkiAHeBJIBAzYuMZgBAKABAcgBCMABAQ&sclient=gws-wiz-serp

Thank you very much, I will try.

Link to comment
Share on other sites

jaycedk

This issue is a bit weird, but when playing music from Emby android app, It looks like the app sends playback stop twice.
That manifests in an error in your exporter like this.

An error has occurred while serving metrics:

collected metric "emby_activity" { label:<name:"date" value:"23/01/2023 16:30:45" > label:<name:"name" value:"User has finished playing 4 Non Blondes - Train on Device" > label:<name:"severity" value:"Info" > label:<name:"type" value:"AudioPlaybackStopped" > gauge:<value:1 > } was collected before with the same name and label values

And now its not exporting anything, before I start and stop 2 music tracks, from a web browser.

Is there anyway we can ignore the last stop message of AudioPlaybackStopped ?

This is a really weird one 😄

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
dylan62370

Hello,

On my side it doesn't work when I run docker I get this error:

2023/04/17 09:48:07 open config.yml: no such file or directory
panic: open config.yml: no such file or directory

goroutine 1 [running]:
log.Panicf(0x958042, 0x2, 0xc000147df0, 0x1, 0x1)
	/usr/local/go/src/log/log.go:361 +0xc5
TOomaAh/emby_exporter_go/conf.NewConfig(0x7ffc9d24af47, 0xa, 0x0, 0x0, 0x0)
	/app/conf/conf.go:38 +0xf5
main.main()
	/app/main.go:34 +0xf8


Yet I created a config folder in the emby_exporter_go folder then in the config folder I created the config.yml file.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...