fix(fluent-bit): support additionalLabels in ServiceMonitor#691
fix(fluent-bit): support additionalLabels in ServiceMonitor#691kalavt wants to merge 3 commits intofluent:mainfrom
Conversation
Add support for serviceMonitor.additionalLabels to align with prometheusRule.additionalLabels pattern. This allows Prometheus Operator to discover the ServiceMonitor using label selectors. The existing selector field is maintained for backward compatibility, with additionalLabels taking precedence when both are defined. Fixes fluent#1234 Signed-off-by: Arbin <arbin.cheng@coins.ph>
stevehipwell
left a comment
There was a problem hiding this comment.
Thanks for the PR @kalavt. Could you please read the CONTRIBUTING
guide as this PR is missing changelog entries.
Given that this chart is a pre-release we could remove serviceMonitor.selector as long as we make sure to record it correctly in the changelog.
- Renamed serviceMonitor.selector to serviceMonitor.additionalLabels for consistency with PrometheusRule - Updated CHANGELOG.md with breaking change entry (fluent#691) - Updated values.yaml and templates/servicemonitor.yaml - Regenerated documentation with helm-docs - Fixed markdown formatting with rumdl - All tests verified: helm lint passes This is a breaking change acceptable for v0.x chart versions. Users need to rename 'selector' to 'additionalLabels' in their values.yaml. Signed-off-by: Arbin <arbin.cheng@coins.ph>
Updated PR description and removed serviceMonitor.selector |
|
@kalavt what exactly is the purpose of the this PR, given that the |
PR: Rename serviceMonitor.selector to serviceMonitor.additionalLabels (Breaking Change)
Summary
This PR renames
serviceMonitor.selectortoserviceMonitor.additionalLabelsto align with PrometheusRule's naming convention and eliminate confusion with ServiceMonitor'sspec.selectorfield.Problem Statement
Currently, the ServiceMonitor template uses
.Values.serviceMonitor.selectorfor metadata labels, which:additionalLabelsspec.selector(the ServiceMonitor's pod selector field)Example of the current confusing configuration:
Users often struggle to understand why their ServiceMonitor isn't being discovered by Prometheus, not realizing these are metadata labels, not the spec selector.
Solution
Replace
serviceMonitor.selectorwithserviceMonitor.additionalLabelsfor clear semantics:Why Breaking Change is Acceptable
This is a breaking change but acceptable because:
Benefits
additionalLabelsclearly indicates these are metadata labels, not pod selectorsChanges
Files Modified
templates/servicemonitor.yaml
.Values.serviceMonitor.selectorto.Values.serviceMonitor.additionalLabelsvalues.yaml
selectorparameter toadditionalLabelsin serviceMonitor sectionCHANGELOG.md
Migration Guide
Users need to update their values.yaml:
Before:
After:
Testing
Checklist
just docsjust fmt