| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
The goal is to allow module:provides("foo-bar") with a mod_foo_bar_ prefix
being stripped. It will break any existing modules that use a prefix and have
hyphens instead of underscores. No such modules are known.
|
| |
|
| |
|
|
|
|
| |
Lets you know what to look for with stats:show()
|
|
|
|
|
|
|
| |
hook_stanza was renamed hook_tag in 2012 in 2087d42f1e77
Why do we still have hook_stanza?
Why is this only a warning anyway?
|
|
|
|
|
|
| |
To prevent a situation where you for whatever reason use a full JID that
is currently online and the response ends up routed there instead of the
module:send_iq() handlers.
|
|
|
|
|
| |
Since we don't currently have hooks that includes type and id here, we
need to check those attributes in the handlers.
|
|
|
|
|
|
|
|
|
|
|
| |
This is primarily something that happens with an internal query to
mod_mam, which calls origin.send() several times with results, leading
to the first such result being treated as the final response and
resolving the promise.
Now, these responses pass trough to the underlying origin.send(), where
they can be caught. Tricky but not impossible. For remote queries, it's
even trickier, you would likely need to bind a resource or similar.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The metric subsystem of Prosody has had some shortcomings from
the perspective of the current state-of-the-art in metric
observability.
The OpenMetrics standard [0] is a formalization of the data
model (and serialization format) of the well-known and
widely-used Prometheus [1] software stack.
The previous stats subsystem of Prosody did not map well to that
format (see e.g. [2] and [3]); the key reason is that it was
trying to do too much math on its own ([2]) while lacking
first-class support for "families" of metrics ([3]) and
structured metric metadata (despite the `extra` argument to
metrics, there was no standard way of representing common things
like "tags" or "labels").
Even though OpenMetrics has grown from the Prometheus world of
monitoring, it maps well to other popular monitoring stacks
such as:
- InfluxDB (labels can be mapped to tags and fields as necessary)
- Carbon/Graphite (labels can be attached to the metric name with
dot-separation)
- StatsD (see graphite when assuming that graphite is used as
backend, which is the default)
The util.statsd module has been ported to use the OpenMetrics
model as a proof of concept. An implementation which exposes
the util.statistics backend data as Prometheus metrics is
ready for publishing in prosody-modules (most likely as
mod_openmetrics_prometheus to avoid breaking existing 0.11
deployments).
At the same time, the previous measure()-based API had one major
advantage: It is really simple and easy to use without requiring
lots of knowledge about OpenMetrics or similar concepts. For that
reason as well as compatibility with existing code, it is preserved
and may even be extended in the future.
However, code relying on the `stats-updated` event as well as
`get_stats` from `statsmanager` will break because the data
model has changed completely; in case of `stats-updated`, the
code will simply not run (as the event was renamed in order
to avoid conflicts); the `get_stats` function has been removed
completely (so it will cause a traceback when it is attempted
to be used).
Note that the measure_*_event methods have been removed from
the module API. I was unable to find any uses or documentation
and thus deemed they should not be ported. Re-implementation is
possible when necessary.
[0]: https://openmetrics.io/
[1]: https://prometheus.io/
[2]: #959
[3]: #960
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
:get_directory has so far returned the base directory of the current
module source code. This has worked well so far to load resources which
tend to be included in the same directory, but with the plugin installer
using LuaRocks, extra resources (e.g. templates and other assets) these
are saved in a completely different directory.
In be73df6765b9 core.modulemanager gained some code for finding that
directory and saving it in module.resource_path but now the question is
how this should be reflected in the API.
A survey of community modules suggest the vast majority use the
:get_directory method for locating templates and other assets, rather
than the code (which would use module:require instead).
Therefore this commit changes :get_directory to return the resource_path
when available. This should work for most modules.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Unclear exactly why, but replies to some queries to local modules would
be discarded by stanza_router. This appears to fix it.
|
|
|
|
|
| |
In rare cases, module.host can be a bare JID, in which case this test
did the wrong thing.
|
|
|
|
| |
It's called 'errors' everywhere else except here.
|
|
|
|
|
| |
It got passed as argument to reject() instead of the util.error
function and was lost.
|
|
|
|
|
| |
All cleanup in one spot instead of two, and at the end which fits with
cleanup happening afterwards.
|
|
|
|
| |
It's written like that elsewhere in the send_iq method
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Explicitly disabled module should stay disabled.
|
| |
|
|
|
|
|
|
| |
Multiple paths are rarely used, and leads to less clear code than just
calling module:shared() once per shared table. It also prevents us from
extending the API with new parameters in the future.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| | |
|
|\| |
|
| | |
|
|\| |
|
| | |
|
|\| |
|
| | |
|
|\| |
|
| |
| |
| |
| | |
_G.unpack [luacheck]
|
| | |
|
| | |
|
|\| |
|
| | |
|