feat(monitoring): add remoteWrite to Prometheus and Prometheus Agent mode #228
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Intro
This is a set of changes that allow the monitoring stack to be configured to send metrics to a remote Prometheus receiver, both with our current Prometheus monitoring type and with a new PrometheusAgent type that deploys a more minimal Prometheus installation only for scraping and sending metrics.
Prometheus Agent mode
The Agent mode optimizes Prometheus for the remote write use case. It disables querying, alerting, and local storage, and replaces it with a customized TSDB WAL. Everything else stays the same: scraping logic, service discovery and related configuration. It can be used as a drop-in replacement for Prometheus if you want to just forward your data to a remote Prometheus server or any other Remote-Write-compliant project.
Notice that with Agent mode:
kubectl top
and similar won't show resources usage, becauseprometheus-adapter
does not work with agent mode (it can't query prometheus for the metrics).If any of the previous points is a blocker for a particular use-case, say you want to be able to see resources usage with
kubectl top
, you can fallback to the regularprometheus
monitoring type and configure theremoteWrite
section setting a low retention to minimise resource usage instead of using theprometheusAgent
type.Changes in this PR
remoteWrite
section to prometheus' configuration in the schema, so Prometheus can be set up to send metrics to a remote receiver.none
.Refs
fixes https://github.com/sighupio/product-management/issues/484