1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-15 16:56:24 +00:00
Commit graph

27 commits

Author SHA1 Message Date
Simon Pasquier
11249283c2
chore: reduce code duplication in agent controller
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2024-12-24 17:10:46 +01:00
dongjiang
ca3db528a0
Fix: Remove scrapeFallbackProtocol in Prometheus CommonSpec (#7197)
* move common scrapeFallbackProtocol

Signed-off-by: dongjiang <dongjiang1989@126.com>
2024-12-16 18:42:19 +05:30
dongjiang
d3b8e5921d
feat: add support fallback_scrape_protocol option for each scrape CRD and globally (#7131)
* add fallback scrape protocol


---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
2024-11-21 10:35:54 +01:00
Hélia Barroso
ef69943905
[FEAT] - Add metric_name_validation_scheme (#7116)
---------

Signed-off-by: Hélia Barroso <helia_barroso@hotmail.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2024-11-20 11:23:37 +01:00
dongjiang
2d5b11ad21
feat: add support --web.enable-otlp-receiver flag in the Prometheus/PrometheusAgent CRD (#7105)
* add otlp receiver

---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2024-11-15 17:14:04 +01:00
Simon Pasquier
d728a1ce9d
fix: add runtime configuration for PrometheusAgent
In #6667, we forgot to support the new runtime configuration for the
PrometheusAgent CRD.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2024-11-08 09:19:56 +01:00
Simon Pasquier
aa58fe3f4c
feat: add support for Remote Write v2.0
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>
2024-10-23 10:51:21 +02:00
Stavros Foteinopoulos
d723855170
Add ability for custom DNSConfig and DNSPolicy (#3899)
---------

Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2024-10-08 17:00:40 +02:00
dongjiang
50d94c0e2e
feat: Support OutOfOrderTimeWindow field for PrometheusAgent (#6851)
* update PrometheusAgent

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
2024-08-21 15:46:19 +02:00
Simon Pasquier
f2f5e22381
chore: upgrade k8s dependencies to v1.31.0
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2024-08-19 11:31:35 +02:00
dongjiang
304ca66537
feat: support new otlp receiver configuration (#6780)
---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2024-08-14 16:15:03 +02:00
Marek Słabicki
813bc2b6b9
Add ServiceDiscoveryRole configuration to toggle service discovery via EndpointSlice vs Endpoints (#6672)
* 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>
2024-07-25 09:15:52 +02:00
Simon Pasquier
2e151cf1c0
chore: bump code-generator to v0.30.1
The gen tools arguments have changed a bit, the Makefile commands have
been adjusted accordingly.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2024-06-07 11:25:50 +02:00
Ha Anh Vu
fa37a770ef
Add mode field in PrometheusAgent CRD (#6640)
* Add mode field in PrometheusAgent CRD
2024-06-04 12:17:29 +02:00
Stefan Caraiman
733d2fe5f6 fix: make automountServiceAccountToken configurable
Fixes https://github.com/prometheus-operator/prometheus-operator/issues/6270

Signed-off-by: Stefan Caraiman <stefanc.caraiman@gmail.com>
2024-04-16 17:26:24 +03:00
Simon Pasquier
3e0d0f86f2 change: define enableFeatures list as a set
It allows different actors to manipulate the list of enabled features
using server-side apply.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2024-04-04 15:08:50 +02:00
Nicolas Takashi
a70f1945b9
feat: adding scrape class (#6199)
* feat: adding scrape class

Signed-off-by: Nicolas Takashi <nicolas.tcs@hotmail.com>

* Update pkg/apis/monitoring/v1/prometheus_types.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Update pkg/prometheus/promcfg.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Update pkg/prometheus/store.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>

* Update pkg/prometheus/resource_selector.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Update pkg/prometheus/store.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>

* Update pkg/prometheus/resource_selector.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>

* Update pkg/prometheus/resource_selector.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Update pkg/prometheus/promcfg.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>

* Update pkg/prometheus/promcfg.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>

* Update pkg/prometheus/server/operator.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>

* Update pkg/prometheus/promcfg.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>

* Update prometheus_types.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>

---------

Signed-off-by: Nicolas Takashi <nicolas.tcs@hotmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2024-02-23 15:15:16 -03:00
dongjiang
18265de80e
feat: support scrape_protocols for GlobalConfig and ScrapeConfig (#6235)
* support scrape_protocols for GlobalConfig and ScrapeConfig

---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2024-01-22 15:09:02 +01:00
Nicolas Takashi
01765e5a76
chore: Adding StartupProbeTimeoutSeconds to Prometheus CRD (#6137)
---------

Signed-off-by: Nicolas Takashi <nicolas.tcs@hotmail.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2023-12-19 14:12:42 +01:00
Nicolas Takashi
0d91832394
Add additionalLabels field to TopologySpreadConstraint (#5967)
---------

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2023-12-07 11:48:27 +01:00
Simon Pasquier
a143c8da5d feat: enable config reload via signal
This commit adds the option to reload Prometheus configuration using
signal instead of the /-/reload endpoint.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2023-11-27 11:17:10 +01:00
Adin Hodovic
c0f9cef3fa
feat: Add support for configuring STS persistentVolumeClaimRetentionPolicy (#6038)
Signed-off-by: adinhodovic <hodovicadin@gmail.com>
2023-11-14 09:41:40 -03:00
Jayapriya Pai
0a93915921
feat: add keep_dropped_targets limit to CRDs (#5897)
Fixes #5875

Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
2023-09-07 16:59:09 +00:00
Mohamed Chiheb Ben Jemaa
ec8188c48b
feat: update Prometheus to v2.45.0 & Add global limits fields (#5646)
Add global limits field to Prometheus

Co-authored-by: Arthur Silva Sens <arthur.sens@coralogix.com>
2023-07-21 21:55:47 +00:00
Gaurav Joshi
6e6aee34de
chore:Moved PrometheusTracingConfig to CommonPrometheusFields (#5640)
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
2023-06-07 11:34:36 +02:00
Guillaume Hérail
b07f92c4ed
feat: Add ScrapeConfig CRD (#5335)
* 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>
2023-05-03 15:54:31 +01:00
Arthur Silva Sens
cc47b1e160
Prometheus Agent support (#5385)
* 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>
2023-03-27 12:30:01 +02:00