karrieretutor / jitsi-prom-exporter

prometheus
Apache License 2.0
37 stars 26 forks source link

Metrics are missing #6

Closed titansmc closed 4 years ago

titansmc commented 4 years ago

Hi, It seems that there are some metrics missing from what I can compare with your output. Am I missing any variable to make it working?

docker run -d -p 8080:8080 -e XMPP_USER=prometheus-user -e XMPP_PW=4asdfMasdfow -e XMPP_AUTH_DOMAIN=auth.meet.domain.com -e XMPP_SERVER=10.12.3.241 -e XMPP_INTERNAL_MUC_DOMAIN=conference.meet.domain.com karrieretutor/jitsi:prom-exporter-latest
xemacs@alatxa:~$ curl http://meet.domain.com:8080/metrics
# HELP conference_sizes_combined All active conference_sizes summed up into this histogram, see conference_sizes
# TYPE conference_sizes_combined histogram
conference_sizes_combined_bucket{le="+Inf"} 0
conference_sizes_combined_sum 0
conference_sizes_combined_count 0
# HELP go_gc_duration_seconds A summary of the GC invocation durations.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 1.1239e-05
go_gc_duration_seconds{quantile="0.25"} 1.5906e-05
go_gc_duration_seconds{quantile="0.5"} 8.882e-05
go_gc_duration_seconds{quantile="0.75"} 0.000156942
go_gc_duration_seconds{quantile="1"} 0.000307765
go_gc_duration_seconds_sum 0.001352204
go_gc_duration_seconds_count 14
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge
go_goroutines 15
# HELP go_info Information about the Go environment.
# TYPE go_info gauge
go_info{version="go1.12.9"} 1
# HELP go_memstats_alloc_bytes Number of bytes allocated and still in use.
# TYPE go_memstats_alloc_bytes gauge
go_memstats_alloc_bytes 3.757032e+06
# HELP go_memstats_alloc_bytes_total Total number of bytes allocated, even if freed.
# TYPE go_memstats_alloc_bytes_total counter
go_memstats_alloc_bytes_total 5.1071328e+07
# HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table.
# TYPE go_memstats_buck_hash_sys_bytes gauge
go_memstats_buck_hash_sys_bytes 1.447803e+06
# HELP go_memstats_frees_total Total number of frees.
# TYPE go_memstats_frees_total counter
go_memstats_frees_total 89628
# HELP go_memstats_gc_cpu_fraction The fraction of this program's available CPU time used by the GC since the program started.
# TYPE go_memstats_gc_cpu_fraction gauge
go_memstats_gc_cpu_fraction 9.703317406112299e-06
# HELP go_memstats_gc_sys_bytes Number of bytes used for garbage collection system metadata.
# TYPE go_memstats_gc_sys_bytes gauge
go_memstats_gc_sys_bytes 2.377728e+06
# HELP go_memstats_heap_alloc_bytes Number of heap bytes allocated and still in use.
# TYPE go_memstats_heap_alloc_bytes gauge
go_memstats_heap_alloc_bytes 3.757032e+06
# HELP go_memstats_heap_idle_bytes Number of heap bytes waiting to be used.
# TYPE go_memstats_heap_idle_bytes gauge
go_memstats_heap_idle_bytes 6.1612032e+07
# HELP go_memstats_heap_inuse_bytes Number of heap bytes that are in use.
# TYPE go_memstats_heap_inuse_bytes gauge
go_memstats_heap_inuse_bytes 4.808704e+06
# HELP go_memstats_heap_objects Number of allocated objects.
# TYPE go_memstats_heap_objects gauge
go_memstats_heap_objects 5839
# HELP go_memstats_heap_released_bytes Number of heap bytes released to OS.
# TYPE go_memstats_heap_released_bytes gauge
go_memstats_heap_released_bytes 0
# HELP go_memstats_heap_sys_bytes Number of heap bytes obtained from system.
# TYPE go_memstats_heap_sys_bytes gauge
go_memstats_heap_sys_bytes 6.6420736e+07
# HELP go_memstats_last_gc_time_seconds Number of seconds since 1970 of last garbage collection.
# TYPE go_memstats_last_gc_time_seconds gauge
go_memstats_last_gc_time_seconds 1.5846329184590359e+09
# HELP go_memstats_lookups_total Total number of pointer lookups.
# TYPE go_memstats_lookups_total counter
go_memstats_lookups_total 0
# HELP go_memstats_mallocs_total Total number of mallocs.
# TYPE go_memstats_mallocs_total counter
go_memstats_mallocs_total 95467
# HELP go_memstats_mcache_inuse_bytes Number of bytes in use by mcache structures.
# TYPE go_memstats_mcache_inuse_bytes gauge
go_memstats_mcache_inuse_bytes 6944
# HELP go_memstats_mcache_sys_bytes Number of bytes used for mcache structures obtained from system.
# TYPE go_memstats_mcache_sys_bytes gauge
go_memstats_mcache_sys_bytes 16384
# HELP go_memstats_mspan_inuse_bytes Number of bytes in use by mspan structures.
# TYPE go_memstats_mspan_inuse_bytes gauge
go_memstats_mspan_inuse_bytes 34560
# HELP go_memstats_mspan_sys_bytes Number of bytes used for mspan structures obtained from system.
# TYPE go_memstats_mspan_sys_bytes gauge
go_memstats_mspan_sys_bytes 81920
# HELP go_memstats_next_gc_bytes Number of heap bytes when next garbage collection will take place.
# TYPE go_memstats_next_gc_bytes gauge
go_memstats_next_gc_bytes 4.194304e+06
# HELP go_memstats_other_sys_bytes Number of bytes used for other system allocations.
# TYPE go_memstats_other_sys_bytes gauge
go_memstats_other_sys_bytes 1.253757e+06
# HELP go_memstats_stack_inuse_bytes Number of bytes in use by the stack allocator.
# TYPE go_memstats_stack_inuse_bytes gauge
go_memstats_stack_inuse_bytes 688128
# HELP go_memstats_stack_sys_bytes Number of bytes obtained from system for stack allocator.
# TYPE go_memstats_stack_sys_bytes gauge
go_memstats_stack_sys_bytes 688128
# HELP go_memstats_sys_bytes Number of bytes obtained from system.
# TYPE go_memstats_sys_bytes gauge
go_memstats_sys_bytes 7.2286456e+07
# HELP go_threads Number of OS threads created.
# TYPE go_threads gauge
go_threads 13
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 0.44
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 1.048576e+06
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 9
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 1.462272e+07
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.5846325655e+09
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 1.17485568e+08
# HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes.
# TYPE process_virtual_memory_max_bytes gauge
process_virtual_memory_max_bytes -1
# HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served.
# TYPE promhttp_metric_handler_requests_in_flight gauge
promhttp_metric_handler_requests_in_flight 1
# HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code.
# TYPE promhttp_metric_handler_requests_total counter
promhttp_metric_handler_requests_total{code="200"} 76
promhttp_metric_handler_requests_total{code="500"} 0
promhttp_metric_handler_requests_total{code="503"} 0
dan-neumann commented 4 years ago

Hi,

I had the same issue at first as my jitsi meet was not properly configured to use the mucs, are you sure they publish their stats there? This output comes if the exporter does not receive any stats through the muc. The internal muc usually starts with internal, the conference one is often the one for the actual conferences. Maybe you are not in the right muc. Take a look into your jvb sip configuration there shoulb be a line

org.jitsi.videobridge.xmpp.user.shard1.MUC_JIDS=jvbbrewery@internal.auth.example.com

Take the last part behind the @ and use it as XMPP_INTERNAL_MUC_DOMAIN in the exporter.

Otherwise could you please poste the logs of the exporter? And the sip configuration of your jvb? That would make it much more easier to help you.

Regards, Daniel

titansmc commented 4 years ago

Hi Dan, Thanks for your help. I have followed the instructions from the website and used the packages for Ubuntu. The JVB SIP only has one line:

root@ops-meet01:~# cat  /etc/jitsi/videobridge/sip-communicator.properties 
org.jitsi.videobridge.AUTHORIZED_SOURCE_REGEXP=focus@auth.meet.domain.de/.*

If I start it XMPP_INTERNAL_MUC_DOMAIN=conference.meet.domain.de:

starting streammanger
SEND:
<?xml version='1.0'?><stream:stream to='auth.meet.domain.de' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>

RECV:
<?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en' from='auth.meet.domain.de' id='a681019f-a4c8-42cf-be1d-594f555687ab' version='1.0' xmlns='jabber:client'><stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'><required/></starttls></stream:features>

SEND:
<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>

RECV:
<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>

SEND:
<?xml version='1.0'?><stream:stream to='auth.meet.domain.de' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>

RECV:
<?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en' from='auth.meet.domain.de' id='263d16e9-af9e-4000-b04e-b743cfac55b6' version='1.0' xmlns='jabber:client'><stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>SCRAM-SHA-1-PLUS</mechanism></mechanisms></stream:features>

SEND:
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AHByb21ldGhldXMtdXNlcgA0UTB5TTZ4dm93</auth>

RECV:
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>

SEND:
<?xml version='1.0'?><stream:stream to='auth.meet.domain.de' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>

RECV:
<?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en' from='auth.meet.domain.de' id='e5f81511-235d-4b13-98e0-a836642b7d57' version='1.0' xmlns='jabber:client'><stream:features><c hash='sha-1' ver='wBlvgkM1+mhpz81eJoge4hYoI0Q=' node='http://prosody.im' xmlns='http://jabber.org/protocol/caps'/><ver xmlns='urn:xmpp:features:rosterver'/><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><required/></bind><session xmlns='urn:ietf:params:xml:ns:xmpp-session'><optional/></session></stream:features>

SEND:
<iq type='set' id='1'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/></iq>

RECV:
<iq id='1' type='result'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>prometheus-user@auth.meet.domain.de/92f21e2d-d380-4083-b40b-fbbec2669b3a</jid></bind></iq>

SEND:
<iq type='set' id='2'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>

RECV:
<iq id='2' type='result' to='prometheus-user@auth.meet.domain.de/92f21e2d-d380-4083-b40b-fbbec2669b3a'/>

SEND:
<presence/>

SEND:
<presence id="784d4690-30d7-439c-93aa-1f8ec7d374b5" from="prometheus-user@auth.meet.domain.de/92f21e2d-d380-4083-b40b-fbbec2669b3a" to="jvbbrewery@conference.meet.domain.de/prom-exporter"><x xmlns="http://jabber.org/protocol/muc"></x></presence>

RECV:
<presence from='prometheus-user@auth.meet.domain.de/92f21e2d-d380-4083-b40b-fbbec2669b3a'/><presence id='784d4690-30d7-439c-93aa-1f8ec7d374b5' to='prometheus-user@auth.meet.domain.de/92f21e2d-d380-4083-b40b-fbbec2669b3a' from='jvbbrewery@conference.meet.domain.de/prom-exporter'><x xmlns='http://jabber.org/protocol/muc#user'><item jid='prometheus-user@auth.meet.domain.de/92f21e2d-d380-4083-b40b-fbbec2669b3a' affiliation='owner' role='moderator'/><status code='110'/></x></presence>

And if I start is with XMPP_INTERNAL_MUC_DOMAIN=internal.auth.domain.de this is the error:

RECV:
<presence from='prometheus-user@auth.meet.domain.de/1063c7b3-469a-4735-8dbd-debd224060dc'/>

RECV:
<presence id='28ea3d21-b6da-44ec-be21-b9f7a27eb90f' type='error' to='prometheus-user@auth.meet.domain.de/1063c7b3-469a-4735-8dbd-debd224060dc' from='jvbbrewery@internal.auth.domain.de/prom-exporter'><error type='cancel'><remote-server-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Server-to-server connection failed: DNS resolution failed</text></error></presence>

I appreciate your help, specially in those moments where all IT efforts are needed for keeping the bussines running.

dan-neumann commented 4 years ago

Hi, From what I know the bridge does not publish stats by default. Your videobridge needs to be configured to comunicate with Jicofo through muc (multi user chat). For me that was the most difficult part, as it is not very well documented.

Your JVB sip should contain something like:

# Enable broadcasting stats/presence in a MUC
org.jitsi.videobridge.ENABLE_STATISTICS=true
org.jitsi.videobridge.STATISTICS_TRANSPORT=muc

# Connect to the first XMPP server
org.jitsi.videobridge.xmpp.user.xmppserver1.HOSTNAME=example.net
org.jitsi.videobridge.xmpp.user.xmppserver1.DOMAIN=auth.example.net
org.jitsi.videobridge.xmpp.user.xmppserver1.USERNAME=jvb
org.jitsi.videobridge.xmpp.user.xmppserver1.PASSWORD=$PASSWORD
org.jitsi.videobridge.xmpp.user.xmppserver1.MUC_JIDS=JvbBrewery@internal.auth.example.net
org.jitsi.videobridge.xmpp.user.xmppserver1.MUC=JvbBrewery@internal.auth.boris2.jitsi.net
org.jitsi.videobridge.xmpp.user.xmppserver1.MUC_NICKNAME=unique-instance-id
#org.jitsi.videobridge.xmpp.user.xmppserver1.DISABLE_CERTIFICATE_VERIFICATION=true

You find some more details here: https://github.com/jitsi/jitsi-videobridge/blob/master/doc/muc.md

Note that in the config JVB_OPTS="--apis=rest"needs to be set and JVB_HOST= and JVB_HOSTNAME= need to be both empty, that is undocumented, but I found the hints here: https://community.jitsi.org/t/loadbalancing-octo-tracking-feature/19816/20.

I hope that helps you.

titansmc commented 4 years ago

Thanks Dan, I t seems that I finally got it working, just as a note, I had to add JVB_OPTS="--apis=xmpp,rest" and the JVB_HOST= and JVB_HOSTNAME= had to be non empty.

I needed to create XMPP user as per: https://github.com/jitsi/jitsi-videobridge/blob/master/doc/muc.md#xmpp-server-configuration

And then put the password and the username in :

the /etc/jitsi/videobridge/sip-communicator.properties looks like:

org.jitsi.videobridge.AUTHORIZED_SOURCE_REGEXP=focus@auth.meet.domain.de/.*
org.jitsi.videobridge.ENABLE_STATISTICS=true
org.jitsi.videobridge.STATISTICS_TRANSPORT=muc
org.jitsi.jicofo.BRIDGE_MUC=JvbBrewery@conference.meet.domain.de

# Connect to the first XMPP server
org.jitsi.videobridge.xmpp.user.xmppserver1.HOSTNAME=meet.domain.de
org.jitsi.videobridge.xmpp.user.xmppserver1.DOMAIN=auth.meet.domain.de
org.jitsi.videobridge.xmpp.user.xmppserver1.USERNAME=jvb
org.jitsi.videobridge.xmpp.user.xmppserver1.PASSWORD=yourpassgoeshere
org.jitsi.videobridge.xmpp.user.xmppserver1.MUC_JIDS=JvbBrewery@conference.meet.domain.de
org.jitsi.videobridge.xmpp.user.xmppserver1.MUC=JvbBrewery@conference.meet.domain.de
org.jitsi.videobridge.xmpp.user.xmppserver1.MUC_NICKNAME=unique-instance-id

the /etc/jitsi/videobridge/config

# Jitsi Videobridge settings

# sets the XMPP domain (default: none)
JVB_HOSTNAME=meet.domain.de

# sets the hostname of the XMPP server (default: domain if set, localhost otherwise)
JVB_HOST=localhost

# sets the port of the XMPP server (default: 5275)
JVB_PORT=5347

# sets the shared secret used to authenticate to the XMPP server
JVB_SECRET=drsfddfsdfasdf

# extra options to pass to the JVB daemon
JVB_OPTS="--apis=xmpp,rest"

# adds java system props that are passed to jvb (default are for home and logging config file)
JAVA_SYS_PROPS="-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/jitsi -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=videobridge -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/jitsi -Djava.util.logging.config.file=/etc/jitsi/videobridge/logging.properties"

For the jicofo /etc/jitsi/jicofo/config

# Jitsi Conference Focus settings
# sets the host name of the XMPP server
JICOFO_HOST=localhost

# sets the XMPP domain (default: none)
JICOFO_HOSTNAME=meet.domain.de

# sets the secret used to authenticate as an XMPP component
JICOFO_SECRET=qwerqwer

# sets the port to use for the XMPP component connection
JICOFO_PORT=5347

# sets the XMPP domain name to use for XMPP user logins
JICOFO_AUTH_DOMAIN=auth.meet.domain.de

# sets the username to use for XMPP user logins
JICOFO_AUTH_USER=focus

# sets the password to use for XMPP user logins
JICOFO_AUTH_PASSWORD=asdfasd

# extra options to pass to the jicofo daemon
JICOFO_OPTS=""

# adds java system props that are passed to jicofo (default are for home and logging config file)
JAVA_SYS_PROPS="-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/jitsi -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=jicofo -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/jitsi -Djava.util.logging.config.file=/etc/jitsi/jicofo/logging.properties"

/etc/jitsi/jicofo/sip-communicator.properties stays empty