Prometheus Exporter for Janus

798 views
Skip to first unread message

moul...@gmail.com

unread,
Feb 1, 2021, 8:01:38 AM2/1/21
to meetecho-janus
Hello Team,

I understand that Janus admin API is available to monitor the media and server traffic using the below link: 


But, I would like to know is there any good exporter library is available for Prometheus like below for PM2 (NodeJS):


As we can get all the required parameters by using one library, it becomes very easy to monitor by using Grafana tool. Thank you.

Best Regards,
Chandramouli.

Mirko Brankovic

unread,
Feb 1, 2021, 9:19:21 AM2/1/21
to meetecho-janus
I guess you can use any of the MTTQ or RabbitMQ transports to emit events only with https://prometheus.io/docs/instrumenting/exporters/#messaging-systems
If I'm not misunderstanding something

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/389078c9-8cde-4579-8153-d88d3b0bb6e1n%40googlegroups.com.


--
Regards,
Mirko

moul...@gmail.com

unread,
Feb 1, 2021, 1:33:30 PM2/1/21
to meetecho-janus
I don't think so ... Thank you very much for your reply.

moul...@gmail.com

unread,
Feb 2, 2021, 12:55:52 AM2/2/21
to meetecho-janus
Hello,

Any update would be appreciated. Thank you.

Best Regards,
Chandramouli.

Lorenzo Miniero

unread,
Feb 2, 2021, 6:02:34 AM2/2/21
to meetecho-janus
Check event handlers: https://janus.conf.meetecho.com/docs/eventhandlers
We have a few that can shoot events in realtime via different protocols (HTTP, WS, RabbitMQ, MQTT, etc.). Hooking those to Prometheus is up to you, though. You may want to look at Homer, which supports our event handlers and can feed several different backends including, I believe, Prometheus.

L.

moul...@gmail.com

unread,
Feb 11, 2021, 8:23:24 AM2/11/21
to meetecho-janus
Hello Lorenzo,

Good morning and thank you for your reply. I have gone through the event handlers and looks like will take some time to utilize this. Is it possible to enable "prometheus" parameter in any configuration file of the Janus? So, it will simply export the data. Thank you.

Best Regards,
Chandramouli.

moul...@gmail.com

unread,
Feb 12, 2021, 1:57:24 AM2/12/21
to meetecho-janus

Hello,

Any help would be appreciated. Thank you.

Best Regards,
Chandramouli.

Mirko Brankovic

unread,
Feb 12, 2021, 3:38:07 AM2/12/21
to meetecho-janus
I don't remember anyone mentioning Prometheus before, so there is no out-of-the box setting that will work automagically.
You can try any of the Event handlers to send it to Prom. since at the end it is json payload but noone  knows if it will work or not. just try it :D

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.


--
Regards,
Mirko

Hemrajsinh Gharia

unread,
Feb 12, 2021, 3:52:19 AM2/12/21
to meetecho-janus
There is nothing we can use out of the box. We have been using an Event handler. You can enable it from janus.eventhandler.sampleevh.jcfg file and setup a backend value to point to your endpoint. On your endpoint, you will receive all events (configured ones) and from there on you can select and forward the concerned event data to prometheus. Also note that you will need to enable sending events in Janus main config file janus.jcfg

events: {
        broadcast = true
        stats_period = 10 // in seconds

Alvaro Gil

unread,
Feb 12, 2021, 7:35:31 AM2/12/21
to Hemrajsinh Gharia, meetecho-janus
Just a little clarification about how Prometheus work, you don't need
to send/push anything, the most common way is to expose a registry of
metrics on your box through HTTP and add a job in Prometheus to scrape
it at some desired interval.
As others have mentioned EventHandler is the way to go, but don't
think you will just create/update a new metric from each event you get
from Janus, there will not be a 1 to 1 mapping that just works, you
need to establish counters and gauges thoughtfully and keep an eye on
cardinality as well. (An article about that:
https://www.robustperception.io/cardinality-is-key)

El vie, 12 de feb. de 2021 a la(s) 05:52, Hemrajsinh Gharia
(gharia...@gmail.com) escribió:
> To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/68601780-5063-4095-bb92-a21065204406n%40googlegroups.com.



--
Alvaro

Mirko Brankovic

unread,
Feb 12, 2021, 8:07:57 AM2/12/21
to meetecho-janus
Well in that case I think you need some "mediator" in between.
I think it is best if the Event handler would deliver events to some DB driver and you pick them up from DB when you want.
The Problem is that this is useful only for Media event types since they have RTP stats, data you can measure over time, but the rest is mostly plugin messages.
You won't get any host or janus behaviour information from EventHandlers or Janus in general. 



--
Regards,
Mirko

Alvaro Gil

unread,
Feb 12, 2021, 8:30:25 AM2/12/21
to Mirko Brankovic, meetecho-janus
yup, that mediator is actually called the exporter, although you do
not need to persist data as an external storage, you could just keep
data structure for metrics to be scraped while the process is running,
it is more like you give a current snapshot of a given time (the
moment it got scraped) for some stats, as example: rooms counter,
subscribers counter, bandwidth sum, etc. Then you would query
Prometheus in a timebased fashion of what Prometheus scraped and
stored, from as example Grafana, Alertmanager, your own backend etc.

You are right, this will only make sense to room/media based events,
if you are looking for Box behavior, I'd suggest to use Node Exporter,
that will expose host metrics like cpu, ram, io etc. very useful.

In case you are interesed in http, rabbitmq, etc. you need to install
an exporter for each of them.

https://prometheus.io/docs/instrumenting/writing_exporters/
https://github.com/prometheus/node_exporter

El vie, 12 de feb. de 2021 a la(s) 10:07, Mirko Brankovic
(mirkobr...@gmail.com) escribió:
> To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/CAND18T0byJnqkqBez68bBPOJF9ahcHa3Qog29H_5kfvE%2BJAZng%40mail.gmail.com.



--
Alvaro

Hemrajsinh Gharia

unread,
Feb 12, 2021, 10:06:02 AM2/12/21
to Alvaro Gil, meetecho-janus
Yeah, thanks for the correction. Prometheus actually scraps and I mean to say that. Sorry for the confusion. We have such webhook/mediator in place where Janus sends events and we maintain counts/gauge of concern. And then use them to create Grafana dashboard.

Thanks,
Hemrajsinh Gharia


moul...@gmail.com

unread,
Feb 19, 2021, 2:00:37 AM2/19/21
to meetecho-janus
This is really helpful. As you suggested, I have done changes in janus.jcfg and janus.eventhandler.sampleevh.jcfg files. But, I don't understand about the below part:

backend = "http://your.webserver.here/and/a/path"
        #backend_user = "myuser"
        #backend_pwd = "mypwd"

I deployed Apache and Janus in the same machine. Can I give Apache details as localhost? Or which web server details I have to give? Please suggest. Thank you.

Best Regards,
Chandramouli.

Hemrajsinh Gharia

unread,
Feb 19, 2021, 2:11:44 AM2/19/21
to moul...@gmail.com, meetecho-janus
Backend is simply where you want Janus to push all events.

You received this message because you are subscribed to a topic in the Google Groups "meetecho-janus" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/meetecho-janus/P1y0DaSVVUo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/da9b1da4-070d-407f-a558-10f658545091n%40googlegroups.com.

Mirko Brankovic

unread,
Feb 19, 2021, 8:09:30 AM2/19/21
to meetecho-janus
that is if you event listener need to authenticate requests, so not to receive unwanted HTTP requests



--
Regards,
Mirko
Reply all
Reply to author
Forward
0 new messages