-
Notifications
You must be signed in to change notification settings - Fork 3
Add relabel config support to ServiceMonitor #102
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for relabel configurations to the ServiceMonitor API, enabling users to customize how Prometheus labels are processed during metric scraping.
Changes:
- Added
TargetLabels,PodTargetLabels, andEndpointsfields toServiceMonitorSpec - Introduced new
Endpointtype withRelabelConfigsandMetricRelabelConfigsfields - Updated the Prometheus Operator agent to apply user-specified relabel configurations while preserving default pod label mappings
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| api/v1/types.go | Added Endpoint struct and extended ServiceMonitorSpec with target labels and endpoints fields to support relabel configurations |
| api/v1/zz_generated.deepcopy.go | Added generated DeepCopy methods for the new Endpoint type and updated ServiceMonitorSpec DeepCopy to handle new slice fields |
| api/v1/openapi_generated.go | Added OpenAPI schema definitions for Endpoint type and updated ServiceMonitorSpec schema with new fields |
| agents/prometheusoperator/lib.go | Enhanced agent to populate ServiceMonitor with user-specified target labels and merge custom relabel configs with default pod label mappings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Tamal Saha <tamal@appscode.com>
Signed-off-by: Arnob kumar saha <arnob@appscode.com>
No description provided.