Skip to content

Commit 8ad7e8a

Browse files
Add some light labels to the Processed request logs (#19548)
It's pretty hard to remember the order of all of these ambiguous numbers. I assume they're not totally labeled already to cut down on the length when scanning with your eyes. This just adds a few hints of what each grouping is. Spawning from [staring at some Synapse logs](element-hq/matrix-hosted#10631) and cross-referencing the Synapse source code over and over.
1 parent 8a6d9a8 commit 8ad7e8a

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

changelog.d/19548.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add a few labels to the number groupings in the `Processed request` logs.

docs/upgrade.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ No immediate change is necessary, however once the parameter is removed, modules
146146
From this version, when the parameter is passed, an error such as
147147
``Deprecated `deactivation` parameter passed to `set_displayname` Module API (value: False). This will break in 2027.`` will be logged. The method will otherwise continue to work.
148148
149+
## Updated request log format (`Processed request: ...`)
150+
151+
The [request log format](usage/administration/request_log.md) has slightly changed to
152+
include `ru=(...)` and `db=(...)` labels to better disambiguate the number groupings.
153+
Previously, these values appeared without labels.
154+
155+
This only matters if you have third-party tooling that parses the Synapse logs.
156+
149157
# Upgrading to v1.146.0
150158
151159
## Drop support for Ubuntu 25.04 Plucky Puffin, and add support for 25.10 Questing Quokka

docs/usage/administration/request_log.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ HTTP request logs are written by synapse (see [`synapse/http/site.py`](https://g
55
See the following for how to decode the dense data available from the default logging configuration.
66

77
```
8-
2020-10-01 12:00:00,000 - synapse.access.http.8008 - 311 - INFO - PUT-1000- 192.168.0.1 - 8008 - {another-matrix-server.com} Processed request: 0.100sec/-0.000sec (0.000sec, 0.000sec) (0.001sec/0.090sec/3) 11B !200 "PUT /_matrix/federation/v1/send/1600000000000 HTTP/1.1" "Synapse/1.20.1" [0 dbevts]
9-
-AAAAAAAAAAAAAAAAAAAAA- -BBBBBBBBBBBBBBBBBBBBBB- -C- -DD- -EEEEEE- -FFFFFFFFF- -GG- -HHHHHHHHHHHHHHHHHHHHHHH- -IIIIII- -JJJJJJJ- -KKKKKK-, -LLLLLL- -MMMMMMM- -NNNNNN- O -P- -QQ- -RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR- -SSSSSSSSSSSS- -TTTTTT-
8+
2020-10-01 12:00:00,000 - synapse.access.http.8008 - 311 - INFO - PUT-1000- 192.168.0.1 - 8008 - {another-matrix-server.com} Processed request: 0.100sec/-0.000sec ru=(0.000sec, 0.000sec) db=(0.001sec/0.090sec/3) 11B !200 "PUT /_matrix/federation/v1/send/1600000000000 HTTP/1.1" "Synapse/1.20.1" [0 dbevts]
9+
-AAAAAAAAAAAAAAAAAAAAA- -BBBBBBBBBBBBBBBBBBBBBB- -C- -DD- -EEEEEE- -FFFFFFFFF- -GG- -HHHHHHHHHHHHHHHHHHHHHHH- -IIIIII- -JJJJJJJ- -KKKKKK-, -LLLLLL- -MMMMMM- -NNNNNN- O -P- -QQ- -RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR- -SSSSSSSSSSSS- -TTTTTT-
1010
```
1111

1212

synapse/http/site.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,12 @@ def _finished_processing(self) -> None:
638638
if authenticated_entity:
639639
requester = f"{authenticated_entity}|{requester}"
640640

641+
# Updates to this log line should also be reflected in our docs,
642+
# `docs/usage/administration/request_log.md`
641643
self.synapse_site.access_logger.log(
642644
log_level,
643645
"%s - %s - {%s}"
644-
" Processed request: %.3fsec/%.3fsec (%.3fsec, %.3fsec) (%.3fsec/%.3fsec/%d)"
646+
" Processed request: %.3fsec/%.3fsec ru=(%.3fsec, %.3fsec) db=(%.3fsec/%.3fsec/%d)"
645647
' %sB %s "%s %s %s" "%s" [%d dbevts]',
646648
self.get_client_ip_if_available(),
647649
self.synapse_site.site_tag,

0 commit comments

Comments
 (0)