Skip to content
Snippets Groups Projects
Unverified Commit 1530cef1 authored by Nick Mills-Barrett's avatar Nick Mills-Barrett Committed by GitHub
Browse files

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
parent afa17f0e
No related branches found
No related tags found
No related merge requests found
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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment