This change includes the following:
* New `messageVersion` field to the remote write configuration to select
between v1 and v2 message formats.
* New `remoteWriteReceiverMessageVersions` to select which message
format(s) to accept when the remote receiver is configured.
* Stricter validation for the remote write's URL (not breaking since an
empty URL value would already fail the Prometheus configuration
loading)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Add service discovery role in Prometheus and Prometheus Agent CRDs
---------
Co-authored-by: haanhvu <haanh6594@gmail.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
* support scrape_protocols for GlobalConfig and ScrapeConfig
---------
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
This commit adds the option to reload Prometheus configuration using
signal instead of the /-/reload endpoint.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* api/v1alpha1: Add ScrapeConfig CRD
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
* api/v1: Add ScrapeConfig selectors to Prometheus
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
* prometheus/server/operator: Add ScrapeConfig selection logic
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
* prometheus/server/operator: Add static_config generation from ScrapeConfig
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
* prometheus/server/operator: Add file_sd_config and http_sd_config generation from ScrapeConfig
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
* prometheus/server/operator: Check ScrapeConfig permissions before trying to select them
* prometheus/server/operator: Check that the ScrapeConfig CRD is installed
* fix: Apply suggestions from Joao
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
* fix: Apply suggestion from mrueg
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
* fix: Properly generate scrape configurations for PrometheusAgent
Also check that the ScrapeConfig CRD is installed and that the operator has the
right permissions.
* fix: Address Joao's points
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
* fix: ScrapeConfig only needs get,list,watch
References:
- https://github.com/prometheus-operator/prometheus-operator/pull/5335#discussion_r1162861091
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
* fix: Implement ScrapeConfig ResourceEventHandlerFuncs
References:
- https://github.com/prometheus-operator/prometheus-operator/pull/5335#discussion_r1162901259
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
* fix: Missing permissions for prometheus-operator's serviceaccount
* fix: Address Arthur's feedback
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
* fix: Address Simon's feedback
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
* feat: Add ScrapeConfig.HonorTimestamps
* feat: Add ScrapeConfig.HonorLabels
* fix: Address feedback from Joao
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
* fix: Address Simon's feedback
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
* chore: Finalize the move to CRDChecker
* fix: Include ScrapeConfig in e2e tests
* docs: spec.ProbeSelector -> spec.probeSelector
* fix: Don't addEventHandler if we don't have a scrape confirm informer
* fix: Address feedback from Simon and Philip
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Philip Gough <philip.p.gough@gmail.com>
* fix: Wrap error with a better error message
* fix: Linting
---------
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
Co-authored-by: Philip Gough <philip.p.gough@gmail.com>
* Introduce PrometheusAgent CRD
Operator is able to run with PrometheusAgent resources in the cluster, but doesn't do anything with them yet. This is the first step to implement the Prometheus Agent Operator.
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
* Re-enable configmap and secret informers
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 1a71db03db6b41cd0cee9d0193b6ea3884bb5bae)
* Implement Resolve for Agent operator
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 49558165b9178b6c1bda833a48f7bfe1468c942a)
* Operator is able to create Agent Statefulset
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 7a3826683c92f917312c866a2bb6401dc54b95f2)
* Agent Operator creates secret from ServiceMonitors
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 11232669befb4de9d0765dfadfe5fae00b575f11)
* Agent Operator creates secret from PodMonitors
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 5ae551734bac2babc056c86443d15729d43d12b0)
* Agent Operator creates secret from Probes
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 9637612fbbe9617335fd6188271ebf2cc74a3693)
* Agent Operator configures remote-write
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit c4bdf230d527e19f8b77ca5f938b9254ed344f7d)
* Agent Operator configures additionalScrapeConfigs
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit d9f28db764641e682bf4fe8963310f791979c387)
* Implement UpdateStatus
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit c546ecaf3e8b73916df44a8f48b279c6988e32f5)
* Add resource handlers
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 5b83359445e20f88ea5fff80302fce62d58058b9)
* make format
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 6507964ba28f4ebf32ce3203db752444e288c45d)
* Only start agent operator if there is enough permission
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
* Remove node endpoint syncronization from agent operator
The server operator already handles it
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
* Move PrometheusAgent API from v1 to v1alpha1
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
* pkg/prometheus/agent/statefulset.go: Fix image concatenation
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
* Avoid name colisions between Prometheus Agents and Servers
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
* agent/createOrUpdateConfigurationSecret: Do not handle case where servicemonitor and podmonitor selectors are empty
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
* make format
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
* make --always-make format generate
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
* Remove unused fields from Operator struct
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
* Add deployment mode as new selector label for agent/server ssts
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
* WIP: Fix OperatorUpgrade e2e test
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
* Panic if type casting PrometheusInterface doesn't return Prometheus/Agent
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
* Detect whether PrometheusAgent CRD is installed or not
If the operator's service account has all permissions on the cluster and
the CRD isn't installed then the PrometheusAgent controller will run
but fail because of the absence of the CRD.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Create dedicated governing service for Prometheus agent
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
---------
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>