mod_prometheus icon indicating copy to clipboard operation
mod_prometheus copied to clipboard

freeswitch_registrations_active always growing

Open hdiogenes opened this issue 8 years ago • 10 comments

It should be a gauge representing FreeSWITCH Active Registrations, but as it is bound to the sofia::register event it gets incremented at each registration renewal from the endpoints, consequently getting much bigger than the real number of registered endpoints.

hdiogenes avatar Sep 20 '16 15:09 hdiogenes

Yeah. To be honest we probably should change the approach and use 5 some cond sampling of the registration count using the core sql API. I think I left some comments at the top about this.

On Tuesday, 20 September 2016, Humberto Diógenes [email protected] wrote:

It should be a gauge representing FreeSWITCH Active Registrations, but as it is bound to the sofia::register event it gets incremented at each registration renewal from the endpoints, consequently getting much bigger than the real number of registered endpoints.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/moises-silva/mod_prometheus/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AApi2dT_Zjg9WLqxHHpGkrliwJrNSSVCks5qr_eygaJpZM4KBv9p .

Moy

moises-silva avatar Sep 20 '16 15:09 moises-silva

There's a note about counting active sessions, which seems to have a similar problem: mine now are negative (-70 active sessions).

hdiogenes avatar Sep 23 '16 18:09 hdiogenes

yeah I'm back from vacations, I'll see if I can fix that over the weekend, hang in there

moises-silva avatar Sep 23 '16 18:09 moises-silva

@hdiogenes curious thought, did you reload the module? the only case I can see for going negative is if the module was reloaded while calls were being placed

moises-silva avatar Sep 23 '16 18:09 moises-silva

I reloaded a few times, but now it's linearly decreasing since yesterday, and seems to be doing this by itself. The top graph is freeswitch_sessions, the other one is freeswitch_sessions_active:

captura de pantalla 2016-09-23 a las 15 45 24

hdiogenes avatar Sep 23 '16 18:09 hdiogenes

@hdiogenes Are you saying the system is idle (e.g no calls being placed) but just keeps going down? how are you placing calls? any chance you can attach to fs_cli and subscribe to CHANNEL_CREATE and CHANNEL_DESTROY and dump just those events?

moises-silva avatar Sep 26 '16 01:09 moises-silva

@moises-silva Yes, that's what's happening. It does that for a few hours and then stops. I've enabled a log and will attach it here when it happens again.

hdiogenes avatar Sep 26 '16 13:09 hdiogenes

@hdiogenes I made an important fix to the freeswitchrs library this module depends on. If you're still using mod_prometheus you should definitely rebuild it.

I'll be looking at the registrations issue this week as well.

moises-silva avatar May 16 '17 05:05 moises-silva

I had a chance to analyze what is going on with the steadily increasing freeswitch_registrations_active metric. So, I brought up fs_cli. What I can see is that - for existing registrations - those are just renewed using another sofia::register event - there is no preceding expiry, which causes a continuously increasing freeswitch_registrations_active metric in mod_prometheus.

ginkel avatar Jan 01 '18 19:01 ginkel

Yeah @ginkel you're absolutely right. I know how to fix it, but just have not had the time to do it :( In general, even for call count, I think the 'realtime' nature of using events does not justify the trouble of keeping it in sync and it'd be better to just poll every 5 sec with the proper core apis to get the current channel and registration counters whenever possible.

moises-silva avatar Jan 02 '18 16:01 moises-silva