Skip to content
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

Add missing label servicemonitor #2573

Merged
3 changes: 1 addition & 2 deletions internal/manifests/manifestutils/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package manifestutils

import (
"fmt"
"regexp"
"strings"

Expand Down Expand Up @@ -90,6 +89,6 @@ func SelectorMatchLabels(instance metav1.ObjectMeta, component string) map[strin
"app.kubernetes.io/instance": naming.Truncate("%s.%s", 63, instance.Namespace, instance.Name),
"app.kubernetes.io/part-of": "opentelemetry",
"app.kubernetes.io/component": component,
"app.kubernetes.io/name": fmt.Sprintf("%s-monitoring", instance.Name),
"app.kubernetes.io/name": naming.ServiceMonitorSelectorName(instance.Name),
}
}
4 changes: 4 additions & 0 deletions internal/naming/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ func ServiceAccount(otelcol string) string {
func ServiceMonitor(otelcol string) string {
return DNSName(Truncate("%s-collector", 63, otelcol))
}
// ServiceMonitorSelectorName builds the service Monitor name based on the instance.
func ServiceMonitorSelectorName(otelcol string) string {
return DNSName(Truncate("%s-monitoring", 63, otelcol))
}

// PodMonitor builds the pod Monitor name based on the instance.
func PodMonitor(otelcol string) string {
Expand Down
Loading