Ghost/.github
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
..
actions/restore-cache Update actions/cache action to v4 2024-04-18 12:36:07 +02:00
hooks Improved pre-commit hook to automatically remove submodules (#21222) 2024-10-12 03:40:31 -07:00
ISSUE_TEMPLATE Switched our old style bug report template to a form 2021-11-12 10:30:08 +00:00
scripts Added ability to push prometheus metrics to a pushgateway (#21526) 2024-11-05 11:50:39 -08:00
workflows Bumped Node versions in CI 2024-10-23 13:23:35 +02:00
CODE_OF_CONDUCT.md Added contributor code of conduct 2023-10-18 12:10:05 +02:00
codecov.yml Updated workflow for code coverage 2023-07-06 09:24:45 +02:00
CONTRIBUTING.md Added translation gitmoji (#21226) 2024-10-04 16:28:31 +00:00
FUNDING.yml Update FUNDING.yml 2020-07-28 13:19:20 +07:00
PULL_REQUEST_TEMPLATE.md Removed GitHub Copilot for PRs templating value 2023-11-20 11:43:58 +01:00
SUPPORT.md Updated links to docs (#10941) 2019-07-22 18:17:50 +08:00