Mercurial > prosody-modules
annotate mod_log_slow_events/README.markdown @ 5648:c217f4edfc4f
misc/mtail: Start of an mtail config
Stashing it here in case anyone wants to continue working on it.
Currently it's only counting log messages by level.
Due to the permissions set by systemd on Prosody logs, mtail never
managed to start correctly until permissions were manually relaxed.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 17 Sep 2023 13:36:30 +0200 |
parents | d276bf3f0464 |
children |
rev | line source |
---|---|
2896
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 --- |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 labels: |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 - 'Stage-Stable' |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 summary: Log warning when event handlers take too long |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
5 ... |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 Introduction |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 ============ |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 Most activities in Prosody take place within our built-in events framework, for |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 example stanza processing and HTTP request handling, authentication, etc. |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 Modules are able to execute code when an event occurs, and they should return |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 as quickly as possible. Poor performance (e.g. slow or laggy server) can be caused |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 by event handlers that are slow to respond. |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
16 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 This module is able to monitor how long each event takes to be processed, and |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
18 logs a warning if an event takes above a certain amount of time, including |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
19 providing any details about the event such as the user or stanza that triggered it. |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
20 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
21 The aim is to help debug why a server may not be as responsive as it should be, |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
22 and ultimately which module is to blame for that. |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
23 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
24 Configuration |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
25 ====================== |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
26 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
27 There is a single configuration option: |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
28 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
29 ``` |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
30 -- Set the number of seconds an event may take before |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
31 -- logging a warning (fractional values are ok) |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
32 log_slow_events_threshold = 0.5 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
33 ``` |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
34 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
35 Metrics |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
36 ======= |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
37 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
38 In addition to the log messages, a new 'slow_events' metric will be exported to |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
39 your configured stats backend (if any). |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
40 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
41 Compatibility |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
42 ------------- |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
43 |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
44 ------- -------------- |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
45 trunk Works |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
46 0.10 Works |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
47 0.9 Doesn't work |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
48 0.8 Doesn't work |
d276bf3f0464
mod_log_slow_events: Add README
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
49 ------- -------------- |