Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/19040.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update TODO list of conflicting areas where we encounter metrics being clobbered (`ApplicationService`).
10 changes: 7 additions & 3 deletions synapse/util/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,13 @@ def register_hook(
if server_hooks.get(metric_name) is not None:
# TODO: This should be an `assert` since registering the same metric name
# multiple times will clobber the old metric.
# We currently rely on this behaviour as we instantiate multiple
# `SyncRestServlet`, one per listener, and in the `__init__` we setup a new
# LruCache.
#
# We currently rely on this behaviour in a few places:
# - We instantiate multiple `SyncRestServlet`, one per listener, and in the
# `__init__` we setup a new `LruCache`.
# - We instantiate multiple `ApplicationService` (one per configured
# application service) which use the `@cached` decorator on some methods.
#
# Once the above behaviour is changed, this should be changed to an `assert`.
logger.error(
"Metric named %s already registered for server %s",
Expand Down
Loading