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

Set Content-Length for Metrics requests #7730

Merged
merged 2 commits into from
Jun 23, 2020

Conversation

bluecmd
Copy link
Contributor

@bluecmd bluecmd commented Jun 21, 2020

HTTP requires the response to contain a Content-Length header unless chunked encoding is being used.
Prometheus metrics endpoint did not set this, causing software such as prometheus-proxy to not be able to scrape synapse for metrics.

Test by cURL:ing the metrics endpoint on a patched Synapse server:

> GET / HTTP/1.1
> Host: [redacted]:9000
> User-Agent: curl/7.64.0
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: BaseHTTP/0.6 Python/3.7.3
< Date: Sun, 21 Jun 2020 17:15:59 GMT
< Content-Type: text/plain; version=0.0.4; charset=utf-8
< Content-Length: 270468

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file.
  • Pull request includes a sign off
  • Code style is correct (run the linters)

@bluecmd bluecmd force-pushed the patch-1 branch 2 times, most recently from 3f8ed04 to 4ad7573 Compare June 21, 2020 17:07
HTTP requires the response to contain a Content-Length header unless chunked encoding is being used.
Prometheus metrics endpoint did not set this, causing software such as prometheus-proxy to not be able to scrape synapse for metrics.

Signed-off-by: Christian Svensson <blue@cmd.nu>
@bluecmd bluecmd marked this pull request as ready for review June 21, 2020 17:19
@clokep clokep requested a review from a team June 22, 2020 11:24
@erikjohnston erikjohnston merged commit 8bbe87f into matrix-org:develop Jun 23, 2020
@erikjohnston
Copy link
Member

Thanks! :D

babolivier pushed a commit that referenced this pull request Sep 1, 2021
* commit 'dc80a0762':
  1.16.0rc1
  Back out MSC2625 implementation (#7761)
  Additional configuration options for auto-join rooms (#7763)
  Add some metrics for inbound and outbound federation processing times (#7755)
  Explain the purpose of the "tests" conditional dependency requirement (#7751)
  Add another yield point to state res v2 (#7746)
  Move flake8 to end. Don't exit script on failure (#7738)
  Make tox actions work on Debian 10 (#7703)
  Yield during large v2 state res. (#7735)
  add org.matrix.login.jwt so that m.login.jwt can be deprecated (#7675)
  Set Content-Length for Metrics requests (#7730)
  Sync ignored table names in synapse_port_db to current database schema (#7717)
  Allow local media to be marked as safe from being quarantined. (#7718)
  Convert directory handler to async/await (#7727)
  Speed up state res v2 across large state differences. (#7725)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants