Fix Failed to stop metrics warnings in request metrics (#18753)

```
Failed to stop metrics: TypeError("prometheus_client.metrics.MetricWrapperBase.labels() got multiple values for keyword argument 'server_name'")
```

Noticed while running and debugging some tests.

This bug was introduced in
https://github.com/element-hq/synapse/pull/18724
This commit is contained in:
Eric Eastwood
2025-07-31 10:31:45 -05:00
committed by GitHub
parent cd339d52b6
commit a6e326582f
2 changed files with 1 additions and 1 deletions

1
changelog.d/18753.misc Normal file
View File

@@ -0,0 +1 @@
Refactor `Histogram` metrics to be homeserver-scoped.

View File

@@ -243,7 +243,6 @@ class RequestMetrics:
response_timer.labels(
code=response_code_str,
**response_base_labels,
**{SERVER_NAME_LABEL: self.our_server_name},
).observe(time_sec - self.start_ts)
resource_usage = context.get_resource_usage()