[OpenSIPS-Users] [OpenSIPS-Devel] [BLOG] Monitor OpenSIPS using Prometheus and Grafana

Ovidiu Sas osas at voipembedded.com
Sat Feb 27 06:01:46 EST 2021


Hello Razvan,

Thank you for implementing this!
It seems that there is an issue with the pkmem and load statistics modules.
If I load a specific pkmem statistic, it works, but if I load the
whole module, doesn't:
Using this config:
loadmodule "prometheus.so"
  modparam("prometheus", "statistics", "processed_dialogs pkmem: shmem: load:")

leads to this logs during init:
Feb 27 05:53:07 sbc4 opensips: INFO:prometheus:prom_stats_param:
Adding statistic processed_dialogs
Feb 27 05:53:07 sbc4 opensips: INFO:prometheus:prom_stats_param:
Adding statistics module pkmem
Feb 27 05:53:07 sbc4 opensips: INFO:prometheus:prom_stats_param:
Adding statistics module shmem
Feb 27 05:53:07 sbc4 opensips: INFO:prometheus:prom_stats_param:
Adding statistics module load

followed by
Feb 27 05:53:10 sbc4 o[35215]: WARNING:prometheus:mod_init: statistics
module [load] does not exist!
Feb 27 05:53:10 sbc4 o[35215]: WARNING:prometheus:mod_init: statistics
module [pkmem] does not exist!

The pkmem and load stats are not listed:
T 2021/02/27 05:55:55.533373 127.0.0.1:45372 -> 127.0.0.1:8888 [AP] #4
GET /metrics HTTP/1.1.
Host: 127.0.0.1:8888.
User-Agent: curl/7.68.0.
Accept: application/openmetrics-text; version=0.0.1,text/plain.
.


T 2021/02/27 05:55:55.533450 127.0.0.1:8888 -> 127.0.0.1:45372 [AP] #6
HTTP/1.1 200 OK.
Connection: Keep-Alive.
Content-Length: 426.
Content-Type: text/plain; version=0.0.4.
Date: Sat, 27 Feb 2021 05:55:55 GMT.
.


T 2021/02/27 05:55:55.533458 127.0.0.1:8888 -> 127.0.0.1:45372 [AP] #7
# TYPE total_size gauge
total_size{group="shmem"} 33554432
# TYPE max_used_size gauge
max_used_size{group="shmem"} 9283632
# TYPE free_size gauge
free_size{group="shmem"} 24495880
# TYPE used_size gauge
used_size{group="shmem"} 6491456
# TYPE real_used_size gauge
real_used_size{group="shmem"} 9058552
# TYPE fragments gauge
fragments{group="shmem"} 24448
# TYPE processed_dialogs counter
processed_dialogs{group="dialog"} 0

This is using a fresh master:
version: opensips 3.2.0-dev (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC,
Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, CC_O0,
FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
git revision: 5d2a53b91
main.c compiled on 03:43:50 Feb 27 2021 with gcc 9


Thanks,
Ovidiu

On Thu, Feb 25, 2021 at 5:40 AM Răzvan Crainea <razvan at opensips.org> wrote:
>
> Hi, everyone!
>
> Check out our latest blog post[1] to find out how you can monitor your
> OpenSIPS instances with Prometheus[2] using the new Prometheus[3] module
> in OpenSIPS! As a bonus, you can also check how you can display these
> statistics in Grafana[4].
> Any feedback regarding the new module is welcome, and if you get a
> chance to try it, make sure you share your experience with us!
>
> [1]
> https://blog.opensips.org/2021/02/25/monitoring-opensips-using-prometheus-and-grafana/
> [2] http://prometheus.io/
> [3] https://opensips.org/docs/modules/3.2.x/prometheus.html
> [4] https://grafana.com/
>
> Happy hacking!
> --
> Răzvan Crainea
> OpenSIPS Core Developer
> http://www.opensips-solutions.com
>
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel



-- 
VoIP Embedded, Inc.
http://www.voipembedded.com



More information about the Users mailing list