feat: Add ServiceMonitor auto-generation for Prometheus discovery#6126
Open
ntkathole wants to merge 2 commits intofeast-dev:masterfrom
Open
feat: Add ServiceMonitor auto-generation for Prometheus discovery#6126ntkathole wants to merge 2 commits intofeast-dev:masterfrom
ntkathole wants to merge 2 commits intofeast-dev:masterfrom
Conversation
Member
Author
|
cc @astefanutti |
5c8dc3b to
2209c62
Compare
ab3e933 to
0671276
Compare
astefanutti
reviewed
Mar 20, 2026
| func (feast *FeastServices) createServiceMonitor() error { | ||
| logger := log.FromContext(feast.Handler.Context) | ||
| sm := feast.initServiceMonitor() | ||
| if op, err := controllerutil.CreateOrUpdate(feast.Handler.Context, feast.Handler.Client, sm, controllerutil.MutateFn(func() error { |
There was a problem hiding this comment.
Maybe continue using server-side apply like we've started for HPA?
Signed-off-by: ntkathole <[email protected]>
0671276 to
e30ed3b
Compare
Signed-off-by: ntkathole <[email protected]>
e30ed3b to
31ca5de
Compare
astefanutti
reviewed
Mar 20, 2026
| cr := feast.Handler.FeatureStore | ||
| objMeta := feast.GetObjectMetaType(OnlineFeastType) | ||
|
|
||
| return map[string]interface{}{ |
There was a problem hiding this comment.
Maybe use the apply config from the Prometheus operator client?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does / why we need it:
This implements
ServiceMonitorauto-generation for the Feast Operator, enabling automatic Prometheus discovery for Kubernetes deployments when metrics: true is set on the online store. The operator detects themonitoring.coreos.comAPI group at startup. If the Prometheus Operator CRD is absent, ServiceMonitor operations are skipped.Which issue(s) this PR fixes:
Fixes #6072