-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start only used metrics #3096
Start only used metrics #3096
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3096 +/- ##
==========================================
- Coverage 79.08% 79.07% -0.02%
==========================================
Files 386 386
Lines 31829 31824 -5
==========================================
- Hits 25172 25164 -8
- Misses 6657 6660 +3
Continue to review full report at Codecov.
|
8a20453
to
0a340f8
Compare
9ea2274
to
d0c19c9
Compare
Now mod_mam is responsible for starting and updating metrics related to MAM. Thanks to this change MAM metrics will not be reported if Mongoose is started with MAM disabled.
These are unused and replaced by the definitions in global_distrib_metrics.hrl.
It is updated in the module, so it could at least exist.
3819614
to
7a43626
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Let's leave mod_privacy
for now.
This PR addresses the problem of starting metrics for not used modules in MIM which is a performance concern and bad user experience.
Most of the culprits are metrics in the file
mongoose_metrics_definitions
, which are custom hook metrics (they should override the automatic hook metrics). Their handlers, which implement custom logic for updating the metrics, are present in filesmongoose_metrics_hooks
andmongoose_metrics_mam_hooks
.The proposition is to move the place of starting the metrics and registering these custom hooks back to the modules which these metrics concern, while keeping the files with hook code as is, at least for now.
There are some problems left but would require metrics name changes or even a rework of some metrics, which could be breaking changes for the users.
I'm not sure how to approach
modPrivacy*
metrics and would appreciate feedback.There is an issue right now that
mongoose_metrics
contains a list of hooks that don't have generic metrics and have some custom logic to calculate metrics (often weirdly named) based on them (this logic is for example inmongoose_metrics_hooks
).This list can lead to inconsistencies, and the custom logic may sometimes be too coupled with the modules.
My proposition would be to get rid of this list, unify the hook metrics and keep the automatic metrics for all of them (for example with a
hooks
prefix).The custom logic to calculate more complex metrics could maybe be than moved from files like
mongoose_metrics_hooks
to the modules which evokeensure_metrics
or similar functions on startup, so the places which are "responsible" for the metrics.mongoose_metrics_hooks
and similar would keep some very general metrics like the xmpp ones.Other solution could just be to check the metrics ensured based on
mongoose_metrics_definitions
against the configured modules.Metrics that are run for MIM configured without any modules:
Changed by this PR:
mod_csi
.?GLOBAL_DISTRIB_MESSAGES_SENT
inglobal_metrics.hrl
mod_mam
, like the ones below.mod_mam
- now will start inmod_mam_muc
. AddedmodMucMamDroppedIQ
because it was being updated and didn't exist.Problematic/other comments - for now unchanged:
ejabberd_auth:timed_call/4
.ejabberd_local
. Some hooks and their metrics have the_hook
suffix, other not, maybe this could be unified.mongoose_metrics_mam_hooks
as an automatic hook, I think it was supposed to be filtered bymongoose_metrics:filter_hook/1
and is the same asmodMamLookups
but left as is.mod_mam
ones is that the hook is called fromejabberd_c2s
- can these be sent withoutmod_privacy
on? If so, maybe it should stay on by default? If this is not a concern should be moved to start withmod_privacy
. Should anyway be replaced by a generic hook metric in my opinion.mod_register
but just all registered users. I would just delete these (maybe add a different metric formod_register
itself) and keep the automatic hook metric instead of this.modPrivacy*
is run from different places in the code even ifmod_roster
is not enabled.modRegisterCount
.Good ones:
modPrivacyPush
metric is sm_broadcast times sessionCounts per Host.