-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Prometheus support #4238
Prometheus support #4238
Conversation
I will fix dialyzer etc after review. |
I'm going to change subscriber API and leave |
I think you could even not need any changes in ejabberd_hooks, you will need to add two hooks with low and high priority, to get notified at start and of hook, ejabberd_hooks:add/remove accept closures, so you could generate required function on demand. Your function can return 'EXIT' atom to make output from it be ignored. Only issue will be arrity of those function, as you will not receive hook arguments as list, but as multiple arguments in those functions. |
@prefiks Yes. But what if we disable the module ( |
I force pushed changes and left original |
We could also have a configuration parameter to set module parameters as labels. for example: modules:
# ...
mod_prometheus:
hooks:
# Histogram for a hook:
- hook: user_send_packet
type: histogram
help: "Handling of sent messages duration in millisecond"
collect: modules # HERE Output:
Any idea? |
Seems like don't have Dialyzer issue anymore :-) |
@pouriya: Nice PR, good job with ejabberd team! |
I think this should be added to ejabberd-contribs repository: https://github.com/processone/ejabberd-contrib |
|
Yes :) I have almost ready the fixes in ejabberd that will allow this:
I'll complete testing tomorrow and show how to accomplish it. |
Mostly yes :) Do you still have some improvement or fix planned for ejabberd_hooks.erl ? |
@badlop |
@badlop force pushed just ejabberd_hooks changes. When we're ready to accept Prometheus in ejabberd-contrib? |
I've merged this PR with the "hooks subscription" feature. And I've added a new directory in ejabberd-contrib with everything prepared for your mod_prometheus: Now you can create a directory |
@badlop Thanks! |
Example config
Output example (After sending some messages)
Prometheus screenshot