mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-24 21:59:25 -05:00
Make it possible to enable compression for the metrics HTTP resource (#12258)
* Make it possible to enable compression for the metrics HTTP resource This can provide significant bandwidth savings pulling metrics from synapse instances. * Add changelog file. * Fix type hint
This commit is contained in:
parent
afa17f0eab
commit
1530cef192
1
changelog.d/12258.misc
Normal file
1
changelog.d/12258.misc
Normal file
@ -0,0 +1 @@
|
||||
Compress metrics HTTP resource when enabled. Contributed by Nick @ Beeper.
|
@ -261,7 +261,10 @@ class SynapseHomeServer(HomeServer):
|
||||
resources[SERVER_KEY_V2_PREFIX] = KeyApiV2Resource(self)
|
||||
|
||||
if name == "metrics" and self.config.metrics.enable_metrics:
|
||||
resources[METRICS_PREFIX] = MetricsResource(RegistryProxy)
|
||||
metrics_resource: Resource = MetricsResource(RegistryProxy)
|
||||
if compress:
|
||||
metrics_resource = gz_wrap(metrics_resource)
|
||||
resources[METRICS_PREFIX] = metrics_resource
|
||||
|
||||
if name == "replication":
|
||||
resources[REPLICATION_PREFIX] = ReplicationRestResource(self)
|
||||
|
Loading…
Reference in New Issue
Block a user