Enable prometheus exporter on jitsi-meet-turnserver

Hi,

I installed jitsi-meet on a new server, I was used to the docker install so a “normal” one was not that hard. The only issue I’m having is with jitsi-meet-turnserver, It’s working fine but I can’t activate the prometheus exporter. When I set the option prometheus in /etc/turnserver.conf I get this error :

0: Bad configuration format: prometheus

I tried with packages version : 1.0.5056-1 and 1.0.5071-1

Any ideas ? I was thinking of trying to install coturn from the official repo to get the lastest version but will it be ok with the rest of the Jitsi stack ?

Thanks,

Théo

The prometheus option was introduced in coturn in version 4.5.2, unfortunately the newest version packaged for coturn is <4.5.2 for stable Ubuntu/Debian.

I suspect it would work just fine if we compiled latest coturn from repo and replace the binaries, but that’s a baseless guess on my part. I have plans to test it some day, but will be a while before I get round to it.

p.s. I don’t use the docker setup, so not sure how relevant this might be to you.

edit: If you are running on docker, you may want to wait till this is resolved before upgrading to latest coturn: Running on docker with prometheus open keep eating up memory · Issue #666 · coturn/coturn · GitHub

Hey @shawn thanks for the quick and clear answer !

I’ll give a try to install coturn =>4.5.2 to see if I’m able to activate prometheus exporter.

I’ll answer here with the results :slight_smile:

Regarding your edit, I switched to normal .deb install after a few weeks with a lot of issues with coturn and docker. I saw that it was on the roadmap to integrate coturn config in the docker install so I’ll wait a little bit before going back there :slight_smile:

1 Like

Managed to carve out some time to give this a go – compiled coturn-4.5.2 from source and replaced the binaries. /etc/turnserver.conf needed a small tweak (see step 6 below), but other than that all seems to work the same.

Have not done any thorough testing, but things looks promising. Video calls using TURN server works, and I can now use http://127.0.0.1:9641 for healthchecks and http://127.0.0.1:9641/metrics to derive coturn stats.


For anyone who wants to give this a go and perhaps test this more thoroughly, these are the steps gleaned from my notes when installing on Ubuntu 18.04:

  1. Install prometheus-client-c - needed for prometheus support in coturn

    apt-get install -y libmicrohttpd-dev  # needed by libpromhttp-dev
    wget https://github.com/digitalocean/prometheus-client-c/releases/download/v0.1.3/libprom-dev-0.1.3-Linux.deb
    wget https://github.com/digitalocean/prometheus-client-c/releases/download/v0.1.3/libpromhttp-dev-0.1.3-Linux.deb
    dpkg -i libprom-dev-0.1.3-Linux.deb
    dpkg -i libpromhttp-dev-0.1.3-Linux.deb
    
  2. Install other deps needed by coturn

    apt-get install -y pkg-config libssl-dev sqlite3 libsqlite3-dev libevent-dev 
    
    • Note: I’m compiling without redis/postgres/mysql support. If you need support for these, also install libpq-dev (for postgres), libhiredis-dev (for redis), mysql-client and libmysqlclient-dev (mysql)
  3. Download and extract coturn source

    wget https://github.com/coturn/coturn/archive/refs/tags/4.5.2.tar.gz
    tar zxvf 4.5.2.tar.gz
    cd coturn-4.5.2
    
  4. Compile

    ./configure --prefix=/usr/local
    make
    make install
    
  5. Edit /etc/init.d/coturn to change bin path to /usr/local/bin so the new coturn binary is used. I changed the following two lines:

    PATH=/usr/local/bin:/usr/bin:/sbin:/usr/sbin:/bin
    DAEMON=/usr/local/bin/turnserver
    
  6. Edit /etc/turnserver.conf:

    • Remove no-loopback-peers option
    • Add prometheus option
  7. Reload service definition and restart

    systemctl daemon-reload
    systemctl restart coturn
    

:information_source: The steps above assumes that coturn apt package is already installed and TURN service already configured and working as expected.

1 Like

Wow ! Thanks a lot @shawn this is amazing !

I’ll give it a try probably next week and make some thorough testing, I’ll write my feedback here.

Cheers !