mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 19:48:50 +03:00
2ff82c7ac0
ref https://linear.app/ghost/issue/ENG-1796/reuse-tcp-connections-when-sending-metrics-to-the-pushgateway - When we rolled out the prometheus metrics collection, it overwhelmed the pushgateway. Our hypothesis is that Ghost was creating too many new TCP connections to the pushgateway. - The prometheus client was creating a new connection with the pushgateway each time it pushed metrics every 15 seconds. - This commit changes the prometheus client to keep the connection alive, and re-use it instead of creating a new one. - It also limits the number of retries if pushing the metrics fails — after 3 consecutive failures, Ghost will stop retrying and log an error. |
||
---|---|---|
.. | ||
src | ||
test | ||
.eslintrc.js | ||
package.json | ||
README.md | ||
tsconfig.json |
Metrics Server
A standalone server for exporting prometheus metrics from Ghost
Usage
Develop
This is a monorepo package.
Follow the instructions for the top-level repo.
git clone
this repo &cd
into it as usual- Run
yarn
to install top-level dependencies.
Test
yarn lint
run just eslintyarn test
run lint and tests