Ghost/ghost/prometheus-metrics
Chris Raible 2ff82c7ac0
Configured prometheus client to reuse TCP connections to the pushgateway (#21695)
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.
2024-11-21 17:43:33 -08:00
..
src Configured prometheus client to reuse TCP connections to the pushgateway (#21695) 2024-11-21 17:43:33 -08:00
test Configured prometheus client to reuse TCP connections to the pushgateway (#21695) 2024-11-21 17:43:33 -08:00
.eslintrc.js Added ability to push prometheus metrics to a pushgateway (#21526) 2024-11-05 11:50:39 -08:00
package.json Added connection pool metrics to prometheus client (#21576) 2024-11-07 23:01:34 -08:00
README.md Added ability to push prometheus metrics to a pushgateway (#21526) 2024-11-05 11:50:39 -08:00
tsconfig.json Added ability to push prometheus metrics to a pushgateway (#21526) 2024-11-05 11:50:39 -08:00

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.

  1. git clone this repo & cd into it as usual
  2. Run yarn to install top-level dependencies.

Test

  • yarn lint run just eslint
  • yarn test run lint and tests