Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Make it possible to enable compression for the metrics HTTP resource #12258

Merged
merged 3 commits into from
Mar 21, 2022
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/12258.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Compress metrics HTTP resource when enabled. Contributed by Nick @ Beeper.
5 changes: 4 additions & 1 deletion synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ def _configure_named_resource(
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)
Expand Down