Skip to content

Commit bd81620

Browse files
authored
TASK-113041: New configuration options for debug throttling (#813)
Signed-off-by: Doug Koerich <douglas.koerich@bird.com>
1 parent 4f65962 commit bd81620

2 files changed

Lines changed: 95 additions & 1 deletion

File tree

content/momentum/4/config-options-summary.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
lastUpdated: "09/20/2023"
2+
lastUpdated: "12/31/2025"
33
title: "Configuration Options Summary"
44
description: "This chapter lists all configuration options visible in the following scopes global domain host binding binding group security pathway pathway group listener listen peer threadpool debug flags and cluster as well as in the listener specific scope Module specific options are documented in the module documentation and options specific to..."
55
---
@@ -111,6 +111,8 @@ The `Version` column indicated the version(s) of Momentum that support the optio
111111
| [debug](/momentum/4/config/ref-debug-flags) – Set the debug level | na |   | 4.0 and later | debug_flags |
112112
| [debug_flags](/momentum/4/config/ref-debug-flags) *(scope)* – Configure debug verbosity | na |   | 4.0 and later | global |
113113
| [debug_level](/momentum/4/4-module-config) – Set the module debug level (applicable to all modules) (cluster-specific) | na | error | 4.0 and later | cluster |
114+
| [debug_throttle_max_num_same_message](/momentum/4/config/ref-debug-throttle) – Maximum number of identical debug messages to log within an interval | na | 0 | 5.2 and later | global |
115+
| [debug_throttle_period_secs](/momentum/4/config/ref-debug-throttle) – Time interval for debug message throttling, in seconds | na | 1 | 5.2 and later | global |
114116
| [default_binding](/momentum/4/config/ref-default-binding) – Control the default binding | sending | normal | 4.0 and later | global |
115117
| [default_charset](/momentum/4/config/ref-default-charset) – Control the character set | both | us-ascii | 4.0 and later | global, pathway, pathway_group |
116118
| [delay_dsn_max_retry_interval](/momentum/4/config/ref-delay-dsn-max-retry-interval) – Maximum interval for sending DSNs to the sender of a message that has not yet been delivered | sending | 43200 | 4.0 and later | binding, binding_group, domain, global |
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
lastUpdated: "12/31/2025"
3+
title: "Throttling Debug Messages"
4+
description: "Configure throttling to tell Momentum how to suppress repeated debug messages. When using the default logging module the messages will appear in the paniclog. The throttle is a decimal number representing the maximum number of repeated debug messages to log within a specified time interval"
5+
---
6+
7+
When using the default logging module, debug messages will appear in the [paniclog](/momentum/4/log-formats-paniclog)
8+
depending on subsystem and level settings configured in [Debug_Flags](/momentum/4/config/ref-debug-flags). `Debug_Flags` is
9+
usually empty, so very few events are written to the `paniclog`. However, under certain circumstances, you need to get more
10+
information about some subsystem's behavior (e.g., SMTP), then by setting `Debug_Flags`, you can enable more verbose logging
11+
into `paniclog`. On the other hand, depending on the chosen level, `paniclog` may get populated with several lines of the same
12+
message, including some that might not be of your interest.
13+
14+
Momentum’s debug throttling configuration allows you to suppress repeated debug messages. The throttle suppresses the logging
15+
of repeated messages beyond a specified limit during a time interval also specified. It is a global setting that applies to
16+
messages of all subsystems.
17+
18+
> **NOTE:** Debug throttling global configuration **DOES NOT** apply to messages logged at the `CRITICAL`, `ERROR`, or
19+
> `WARNING` levels of any subsystem, due to their relevance for operation and diagnosis.
20+
21+
It is important to note that debug throttling is applied not necessarily to *identical* messages, but to messages that are
22+
considered the same after removing variable parts such as timestamps, IP addresses, or other dynamic content. In other words,
23+
if the source of the message is something like this:
24+
25+
```
26+
<timestamp> Message received from: <mailfrom>
27+
```
28+
29+
then all messages that match this pattern will be considered the same for throttling purposes, regardless of the actual
30+
values of `<timestamp>` and `<mailfrom>`. This happens because the default logging module is based on `printf`-style
31+
format strings, which allows variable content in log messages, and it is the format string that determines message sameness.
32+
33+
> __**_WARNING:_**__ Be cautious when enabling debug throttling, as it may cause some performance overhead due to the additional
34+
> processing required to track and suppress repeated messages.
35+
36+
<a name="conf.ref.debug_throttle"></a>
37+
# Configuration options
38+
39+
Debug throttling is configured using the following options in the global scope of your `ecelerity.conf` file:
40+
- **debug_throttle_max_num_same_message**
41+
- **debug_throttle_period_secs**
42+
43+
<a name="conf.ref.debug_throttle_max_num_same_message"></a>
44+
## Maximum number of the same message
45+
46+
<a name="conf.ref.debug_throttle_max_num_same_message.name"></a>
47+
### Name
48+
49+
`debug_throttle_max_num_same_message`
50+
51+
<a name="conf.ref.debug_throttle_max_num_same_message.description"></a>
52+
### Description
53+
54+
Sets the maximum number of repeated debug messages to log within a specified time interval. The default is `0`, which means no
55+
throttling is applied to the logging of repeated debug messages.
56+
57+
<a name="conf.ref.debug_throttle_period_secs.example"></a>
58+
### Example
59+
60+
```
61+
debug_throttle_max_num_same_message = 5
62+
```
63+
64+
With this configuration, only five lines of the same debug message will be logged during the time interval specified by
65+
`debug_throttle_period_secs`.
66+
67+
<a name="conf.ref.debug_throttle_period_secs"></a>
68+
## Time interval of throttling
69+
70+
<a name="conf.ref.debug_throttle_period_secs.name"></a>
71+
### Name
72+
`debug_throttle_period_secs`
73+
74+
<a name="conf.ref.debug_throttle_period_secs.description"></a>
75+
### Description
76+
77+
Sets the time interval in seconds during which repeated debug messages are counted for throttling purposes. The default is
78+
`1` second, with a maximum of `60` seconds.
79+
80+
<a name="conf.ref.debug_throttle_period_secs.example"></a>
81+
### Example
82+
```
83+
debug_throttle_period_secs = 30
84+
```
85+
With this configuration, the time interval for counting repeated debug messages is set to 30 seconds. Combined with the
86+
previous example for `debug_throttle_max_num_same_message`, only five lines of the same debug message will be logged every
87+
30 seconds.
88+
89+
<a name="conf.ref.debug_throttle.scope"></a>
90+
# Scope
91+
92+
Debug throttling options are valid in the global scope.

0 commit comments

Comments
 (0)