0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/.github/scripts
Chris Raible 190ebcd684
Added ability to push prometheus metrics to a pushgateway (#21526)
ref
https://linear.app/ghost/issue/ENG-1746/enable-ghost-to-push-metrics-to-a-pushgateway

- We'd like to use prometheus to expose metrics from Ghost, but the
"standard" approach of having prometheus scrape the `/metrics` endpoint
adds some complexity and additional challenges on Pro.
- A suggested simpler alternative is to use a pushgateway, to have Ghost
_push_ metrics to prometheus, rather than have prometheus scrape the
running instances.
- This PR introduces this functionality behind a configuration. 
- It also includes a refactor to the current metrics-server
implementation so all the related code for prometheus is colocated, and
the configuration is a bit more organized. `@tryghost/metrics-server`
has been renamed to `@tryghost/prometheus-metrics`, and it now includes
the metrics server and prometheus-client code itself (including the
pushgateway code)
- To enable the prometheus client alone, `prometheus:enabled` must be
true. This will _not_ enable the metrics server or the pushgateway — it
will essentially collect the metrics, but not do anything with them.
- To enable the metrics server, set `prometheus:metrics_server:enabled`
to true. You can also configure the host and port that the metrics
server should export the `/metrics` endpoint on in the
`prometheus:metrics_server` block.
- To enable the pushgateway, set `prometheus:pushgateway:enabled` to
true. You can also configure the pushgateway's `url`, the `interval` it
should push metrics in (in milliseconds) and the `jobName` in the
`prometheus:pushgateway` block.
2024-11-05 11:50:39 -08:00
..
grafana Added prometheus and grafana services to docker compose (#21213) 2024-10-03 14:43:07 -07:00
mysql-preload Added MySQL setup via Docker 2023-12-07 10:57:47 +01:00
prometheus Added prometheus and grafana services to docker compose (#21213) 2024-10-03 14:43:07 -07:00
bump-version.js Exported Git commit hash from update script 2024-09-24 14:08:38 +02:00
clean.sh Added Dev Container setup (#21279) 2024-10-24 11:15:08 -07:00
dev.js Cleaned up browser test output in CI (#21462) 2024-10-30 12:39:41 -07:00
docker-compose.yml Added ability to push prometheus metrics to a pushgateway (#21526) 2024-11-05 11:50:39 -08:00
setup.js Added Dev Container setup (#21279) 2024-10-24 11:15:08 -07:00