Enabling monitoring via Colibri/REST API

I’d like to enable the REST API so I can monitor jitsi’s stats with grafana.

For this, I set the following variables in my .env file:

# A comma separated list of APIs to enable when the JVB is started [default: none]
# See https://github.com/jitsi/jitsi-videobridge/blob/master/doc/rest.md for more information
JVB_ENABLE_APIS=rest,colibri

# See https://github.com/jitsi/docker-jitsi-meet/pull/785
JVB_TCP_API_PORT=8888
JVB_TCP_MAPPED_API_PORT=8888

# XMPP user for Jicofo client connections.
# NOTE: this option doesn't currently work due to a bug
JICOFO_AUTH_USER=focus

# Base URL of Jicofo's reservation REST API
#JICOFO_RESERVATION_REST_BASE_URL=http://reservation.example.com

# Enable Jicofo's health check REST API (http://<jicofo_base_url>:8888/about/health)
JICOFO_ENABLE_HEALTH_CHECKS=true

I also added the '${JVB_TCP_MAPPED_API_PORT}:${JVB_TCP_API_PORT}' mapping to the compose file to expose the videobridge’s API as mentioned in #785.

However, when I navigate to jitsi.example.com:8888/colibri/stats or ...:8888/about/health, the connection is reset. (jitsi.example.com is my regular jitsi domain in this case.)
Docker has opened port 8888 of the JVB container, however it doesn’t really seem to be listening. This makes me think that the metrics are not served yet.
As far as I understand the documentation, this should be all the setting required to make this work. What else am I missing?

If you set the url to port 8888 instead of 8080 what u get ?

http://yoursite:8888/colibri/stats

?

This has worked for me :

nano /etc/jitsi/videobridge/config

Make sure to configure the jvb options:

JVB_OPTS="--apis=rest,xmpp"

and

nano /etc/jitsi/videobridge/sip-communicator.properties

Here we configure colibri statistics:

org.jitsi.videobridge.ENABLE_STATISTICS=true
org.jitsi.videobridge.STATISTICS_TRANSPORT=muc,colibri

service jitsi-videobridge2 restart

I forgot to change that part in my post. I do mean port 8888 of course.

I should also mention that I’m using the docker container but I’ll see how I can set the things you suggested with it.

I looked through the config files but could only find the following:
In config/jvb/jvb.conf:

videobridge {
    //[...]
    apis {
        xmpp-client {
            configs {
                shard {
                    HOSTNAME = "xmpp.meet.jitsi"
                    DOMAIN = "auth.meet.jitsi"
                    USERNAME = "jvb"
                    PASSWORD = "///////////////////"
                    MUC_JIDS = "jvbbrewery@internal-muc.meet.jitsi"
                    MUC_NICKNAME = "//////////////"
                    DISABLE_CERTIFICATE_VERIFICATION = true
                }
            }
        }
    }
    stats {
        enabled = true
    }
    websockets {
        enabled = true
        domain = "jitsi.example.com"
        tls = true
        server-id = "172.21.0.4"
    }
    http-servers {
        private {
          host = 0.0.0.0
        }
        public {
            host = 0.0.0.0
            port = 9090
        }
    }
}

So I most likely have the org.jitsi.videobridge.ENABLE_STATISTICS=true covered. However, the STATISTICS_TRANSPORT does not seem to have been applied.

I also changed my .env file slightly:

JVB_ENABLE_APIS=rest,colibri,xmpp
ENABLE_COLIBRI_WEBSOCKET=1

since you wrote that I’d need xmpp.
However, the xmpp-client section in the file above does not seem to correspond to that xmpp value since it’s also there without it.
The second line enabling the colibri websocket had been there before as well, I just forgot to write that down in my original post.

I also looked a bit through the templates of the docker and can’t seem to find the options you list there.

Check this

Thanks! That worked.

Here’s what I did:

  • enable the rest and colibri APIs (JVB_ENABLE_APIS=rest,colibri) in the .env file
    • There is no need to explicitly enable the colibri websocket
  • fix the port mapping so that the docker-internal port is still 8080 (so 8888:8080)

This leaves me with the following part of the .env file:

# A comma separated list of APIs to enable when the JVB is started [default: none]
# See https://github.com/jitsi/jitsi-videobridge/blob/master/doc/rest.md for more information
JVB_ENABLE_APIS=rest,colibri

# See https://github.com/jitsi/docker-jitsi-meet/pull/785
JVB_TCP_API_PORT=8080 # keep this
JVB_TCP_MAPPED_API_PORT=8888

# XMPP user for Jicofo client connections.
# NOTE: this option doesn't currently work due to a bug
JICOFO_AUTH_USER=focus

# Base URL of Jicofo's reservation REST API
#JICOFO_RESERVATION_REST_BASE_URL=http://reservation.example.com

# Enable Jicofo's health check REST API (http://<jicofo_base_url>:8888/about/health)
JICOFO_ENABLE_HEALTH_CHECKS=true

and the following curl command:
curl localhost:8888/colibri/stats though the FQDN works as well.

I’d also slightly altered the docker-compose file:

# Video bridge
jvb:
    image: jitsi/jvb:stable-6173
    restart: ${RESTART_POLICY}
    ports:
        - '${JVB_PORT}:${JVB_PORT}/udp'
        - '${JVB_TCP_MAPPED_PORT}:${JVB_TCP_PORT}'
        - '${JVB_TCP_MAPPED_API_PORT}:${JVB_TCP_API_PORT}'
# [...]