[sr-dev] [kamailio/kamailio] usrloc: change "-" for "_" in stats name to be prometheus compliant (#2304)

Daniel-Constantin Mierla notifications at github.com
Sat May 2 09:04:51 CEST 2020


@grumvalski - I think it makes no sense to added to the `cfg_group_core / default_core_cfg` structure, because that is for parameters that can be changed at runtime. But, imo, this is not set once and actually use only during startup, when the stats names are exported.

It can simply be a global variable like `int ksr_tcp_accept_hep3=0;`. It can be added to src/core/counters.c and exposed with extern in src/core/globals.h.

The cfg_group_* structures work as a block and making them larger without a reason should be avoided.

In the future probably we should create some structures for global attributes grouped per purpose, so instead of many individual global variables, there will be a few global structure.

As a side node, I would recommend using the `ksr_` prefix for global variables in the core, recently I encounter some issues with global variables being cross visible between object files, so db_mode of permissions module was inherited by usrloc module. Apparently some compilers (or operating systems) build libraries with visibility for all symbols, without adding any prefix.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2304#issuecomment-622762317
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200502/1bbef70a/attachment.html>


More information about the sr-dev mailing list