Annotate

INSTALL @ 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 7359:a5a080c12c96
child 12222:61592927335b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5407
c9ff345a27e7 INSTALL: Update from wiki
Matthew Wild <mwild1@gmail.com>
parents: 4885
diff changeset
1 (This file was created from
7359
a5a080c12c96 Update every link to the documentation to use HTTPS
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 5407
diff changeset
2 https://prosody.im/doc/installing_from_source on 2013-03-31)
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3
5407
c9ff345a27e7 INSTALL: Update from wiki
Matthew Wild <mwild1@gmail.com>
parents: 4885
diff changeset
4 ====== Installing from source ======
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 ==== Dependencies ====
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 There are a couple of libraries which Prosody needs installed before
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 you can build it. These are:
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8
5407
c9ff345a27e7 INSTALL: Update from wiki
Matthew Wild <mwild1@gmail.com>
parents: 4885
diff changeset
9 * lua5.1: The Lua 5.1 interpreter
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10 * liblua5.1: Lua 5.1 library
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 * libssl 0.9.8: OpenSSL
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12 * libidn11: GNU libidn library, version 1.1
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13
5407
c9ff345a27e7 INSTALL: Update from wiki
Matthew Wild <mwild1@gmail.com>
parents: 4885
diff changeset
14 These can be installed on Debian/Ubuntu with the packages: lua5.1
c9ff345a27e7 INSTALL: Update from wiki
Matthew Wild <mwild1@gmail.com>
parents: 4885
diff changeset
15 liblua5.1-dev libidn11-dev libssl-dev
4885
8df3e709f8b7 INSTALL: Update with changes from wiki.
Kim Alvefur <zash@zash.se>
parents: 1192
diff changeset
16
8df3e709f8b7 INSTALL: Update with changes from wiki.
Kim Alvefur <zash@zash.se>
parents: 1192
diff changeset
17 On Mandriva try: urpmi lua liblua-devel libidn-devel libopenssl-devel
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
18
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
19 On other systems... good luck, but please let me know of the best way
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
20 of getting the dependencies for your system and I can add it here.
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
21
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22 ==== configure ====
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
23 The first step of building is to run the configure script. This
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
24 creates a file called 'config.unix' which is used by the next step to
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
25 control aspects of the build process.
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
26
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
27 All options to configure can be seen by running ./configure --help.
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
28 Sometimes you won't need to pass any parameters to configure, but on
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
29 most systems you shall.
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
30
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
31 To make this a little easier, there are a few presets which configure
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32 accepts. You can load a preset using:
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
33
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
34 ./configure --ostype=PRESET
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
35
5407
c9ff345a27e7 INSTALL: Update from wiki
Matthew Wild <mwild1@gmail.com>
parents: 4885
diff changeset
36 Where PRESET can currently be one of: 'debian', 'macosx' or (in 0.8
c9ff345a27e7 INSTALL: Update from wiki
Matthew Wild <mwild1@gmail.com>
parents: 4885
diff changeset
37 and later) 'freebsd'
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
38
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
39 ==== make ====
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
40 Once you have run configure successfully, then you can simply run:
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
41
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
42 make
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
43
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
44 Simple? :-)
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
45
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
46 If you do happen to have problems at this stage, it is most likely
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
47 due to the build process not finding the dependencies. Ensure you
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
48 have them installed, and in the standard library paths for your
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
49 system.
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
50
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
51 For more help, just ask ;-)
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
52
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
53 ==== install ====
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
54 At this stage you should be able to run Prosody simply with:
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
55
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
56 ./prosody
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
57
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
58 There is no problem with this, it is actually the easiest way to do
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
59 development, as it doesn't spread parts around your system, and you
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
60 can keep multiple versions around in their own directories without
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
61 conflict.
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
62
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
63 Should you wish to install it system-wide however, simply run:
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
64
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
65 sudo make install
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
66
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
67 ...it will install into /usr/local/ by default. To change this you
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
68 can pass to the initial ./configure using the 'prefix' option, or
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
69 edit config.unix directly. If the new path doesn't require root
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
70 permission to write to, you also won't need (or want) to use 'sudo'
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
71 in front of the 'make install'.
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
72
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
73 Have fun, and see you on Jabber!