mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-26 19:47:05 +03: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
2 changed files with 5 additions and 1 deletions
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)
|
resources[SERVER_KEY_V2_PREFIX] = KeyApiV2Resource(self)
|
||||||
|
|
||||||
if name == "metrics" and self.config.metrics.enable_metrics:
|
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":
|
if name == "replication":
|
||||||
resources[REPLICATION_PREFIX] = ReplicationRestResource(self)
|
resources[REPLICATION_PREFIX] = ReplicationRestResource(self)
|
||||||
|
|
Loading…
Reference in a new issue