Ghost/ghost/core
Chris Raible d1fbbed3b8 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-06 16:58:37 -06:00
..
content 🎨 Updated Source to v1.3.3 2024-10-27 23:59:38 +00:00
core Added ability to push prometheus metrics to a pushgateway (#21526) 2024-11-06 16:58:37 -06:00
test Added ability to push prometheus metrics to a pushgateway (#21526) 2024-11-06 16:58:37 -06:00
.c8rc.e2e.json Split CI database tests into separate types 2023-05-22 19:34:17 +02:00
.c8rc.json Added email address alignment protections (#19094) 2023-11-23 10:25:30 +01:00
.eslintignore Updated .eslintignore list for core 2022-10-10 15:12:52 +07:00
.eslintrc.js Updated linting and migration comment to improve practices 2023-06-26 15:29:37 +02:00
.npmignore Moved monobundle into monorepo 2023-11-13 13:30:38 +01:00
config.development.json Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
ghost.js Lazyloaded several required dependencies 2024-07-26 09:52:26 +02:00
index.js Removed NewRelic from Ghost 2024-03-18 15:22:33 +01:00
jsconfig.json Deleted reference to core/admin 2022-08-03 16:28:41 +02:00
loggingrc.js Added version information to log lines 2023-01-20 13:18:44 +01:00
MigratorConfig.js Added eslint rule for file naming convention 2023-05-09 12:34:34 -04:00
monobundle.js Tidied up monobundle output 2024-09-11 15:09:27 +02:00
nodemon.json Added Dev Container setup (#21279) 2024-10-24 11:15:08 -07:00
package.json Added ability to push prometheus metrics to a pushgateway (#21526) 2024-11-06 16:58:37 -06:00
playwright.config.js Added Dev Container setup (#21279) 2024-10-24 11:15:08 -07:00