Software /
code /
prosody
File
man/prosodyctl.markdown @ 11523:5f15ab7c6ae5
Statistics: Rewrite statistics backends to use OpenMetrics
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
author | Jonas Schäfer <jonas@wielicki.name> |
---|---|
date | Sun, 18 Apr 2021 11:47:41 +0200 |
parent | 8365:8e079677d724 |
child | 12242:202319a990e7 |
line wrap: on
line source
--- author: - 'Dwayne Bent <dbb.1@liqd.org>' - Kim Alvefur date: '2017-09-02' section: 1 title: PROSODYCTL --- NAME ==== prosodyctl - Manage a Prosody XMPP server SYNOPSIS ======== prosodyctl command [--help] DESCRIPTION =========== prosodyctl is the control tool for the Prosody XMPP server. It may be used to control the server daemon and manage users. prosodyctl needs to be executed with sufficient privileges to perform its commands. This typically means executing prosodyctl as the root user. If a user named "prosody" is found then prosodyctl will change to that user before executing its commands. COMMANDS ======== User Management --------------- In the following commands users are identified by a Jabber ID, jid, of the usual form: user@domain. adduser jid : Adds a user with Jabber ID, jid, to the server. You will be prompted to enter the user's password. passwd jid : Changes the password of an existing user with Jabber ID, jid. You will be prompted to enter the user's new password. deluser jid : Deletes an existing user with Jabber ID, jid, from the server. Daemon Management ----------------- Although prosodyctl has commands to manage the prosody daemon it is recommended that you utilize your distributions daemon management features if you attained Prosody through a package. To perform daemon control commands prosodyctl needs a pidfile value specified in `/etc/prosody/prosody.cfg.lua`. Failure to do so will cause prosodyctl to complain. start : Starts the prosody server daemon. If run as root prosodyctl will attempt to change to a user named "prosody" before executing. This operation will block for up to five seconds to wait for the server to execute. stop : Stops the prosody server daemon. This operation will block for up to five seconds to wait for the server to stop executing. restart : Restarts the prosody server daemon. Equivalent to running prosodyctl stop followed by prosodyctl start. reload : Signals the prosody server daemon to reload configuration and reopen log files. status : Prints the current execution status of the prosody server daemon. Certificates ------------ prosodyctl can create self-signed certificates, certificate requests and private keys for use with Prosody. Commands are of the form `prosodyctl cert subcommand`. Commands take a list of hosts to be included in the certificate. `request hosts` : Create a certificate request (CSR) file for submission to a certificate authority. Multiple hosts can be given, sub-domains are automatically included. `generate hosts` : Generate a self-signed certificate. `key host [size]` : Generate a private key of 'size' bits (defaults to 2048). Invoked automatically by 'request' and 'generate' if needed. `config hosts` : Produce a config file for the list of hosts. Invoked automatically by 'request' and 'generate' if needed. `import hosts paths` : Copy certificates for hosts into the certificate path and reload prosody. Debugging --------- prosodyctl can also show some information about the environment, dependencies and such to aid in debugging. `about` : Shows environment, various paths used by Prosody and installed dependencies. `check [what]` : Performs various sanity checks on the configuration, DNS setup and configured TLS certificates. `what` can be one of `config`, `dns` and `certs` to run only that check. Ejabberd Compatibility ---------------------- ejabberd is another XMPP server which provides a comparable control tool, ejabberdctl, to control its server's operations. prosodyctl implements some commands which are compatible with ejabberdctl. For details of how these commands work you should see ejabberdctl(8). register user server password unregister user server OPTIONS ======= `--config filename` : Use the specified config file instead of the default. `--root` : Don't drop root privileges. `--help` : Display help text for the specified command. FILES ===== `/etc/prosody/prosody.cfg.lua` : The main prosody configuration file. prosodyctl reads this to determine the process ID file of the prosody server daemon and to determine if a host has been configured. ONLINE ====== More information may be found online at: <https://prosody.im/>