chore(inputs.prometheus): Improve label and field selector logging (#16228)

This commit is contained in:
Dane Strandboge 2024-12-09 12:20:25 -06:00 committed by GitHub
parent 14eb97aa7e
commit e713360c69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -183,7 +183,12 @@ func (p *Prometheus) Init() error {
return fmt.Errorf("the field selector %q is not supported for pods", invalidSelector)
}
p.Log.Infof("Using the label selector: %v and field selector: %v", p.podLabelSelector, p.podFieldSelector)
if p.KubernetesLabelSelector != "" {
p.Log.Debugf("Using the label selector: %v", p.podLabelSelector)
}
if p.KubernetesFieldSelector != "" {
p.Log.Debugf("Using the field selector: %v", p.podFieldSelector)
}
for k, vs := range p.NamespaceAnnotationPass {
tagFilter := models.TagFilter{}