Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(monitoring): add remoteWrite to Prometheus and Prometheus Agent mode #228

Merged
merged 4 commits into from
Jul 31, 2024

Conversation

ralgozino
Copy link
Member

@ralgozino ralgozino commented Jun 27, 2024

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:

  • There's no much to do form Prometheus UI, no need for exposing it via ingress.
  • There's no need for Grafana (because it can't query Prometheus for the data).
  • Alertmanager that not work with agent mode (it can't query Prometheus).
  • kubectl top and similar won't show resources usage, because prometheus-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 regular prometheus monitoring type and configure the remoteWrite section setting a low retention to minimise resource usage instead of using the prometheusAgent type.

Changes in this PR

  • Add remoteWrite section to prometheus' configuration in the schema, so Prometheus can be set up to send metrics to a remote receiver.
  • Add prometheusAgent as monitoring type, as an alternative to prometheus+remoteWrite, allowing to have a "minimal" monitoring stack capable of sending metrics to a remote Prometheus receiver. Notice that this mode does not allow for querying the local Prometheus instance (so no local Grafana dashboards) or having local alerting set up.
  • Add migrations for switching between Prometheus and Prometheus Agent, and to and from none.
  • Update documentation with the new features

Refs

fixes https://github.com/sighupio/product-management/issues/484

@ralgozino ralgozino marked this pull request as ready for review June 27, 2024 14:16
@ralgozino ralgozino self-assigned this Jun 27, 2024
…monitoring type

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 intallation only for scraping and sending metrics.

- Add `remoteWrite` section to prometheus' configuration in the scheam, so Prometheus can be set up to send metrics to a remote receiver.
- Add prometheusAgent as monitoring type, as an alternative to prometheus+remoteWrite, allowing to have a "minimal" monitoring stack capable of sending metrics to a remote Prometheus receiver. Notice that this mode does not allow for querying the local Prometheus instance (so no local Grafana dashboards) or having local alerting set up.
- Add migrations for switching between Prometheus and Prometheus Agent, and to and from `none`.
- Update documentation with the new features
- update schema docs with md-gen
- update go models
@nutellinoit nutellinoit changed the base branch from main to feat/v1.29.2 July 31, 2024 07:48
@nutellinoit nutellinoit merged commit 907c80a into feat/v1.29.2 Jul 31, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants