Skip to content

Generate missing service monitors for qfe #930

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

Merged
merged 1 commit into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions magefiles/servicemonitors.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,47 @@ func createServiceMonitors(namespace string) []runtime.Object {
},
},
},
&monitoringv1.ServiceMonitor{
TypeMeta: metav1.TypeMeta{
APIVersion: "monitoring.coreos.com/v1",
Kind: "ServiceMonitor",
},
ObjectMeta: metav1.ObjectMeta{
Name: "thanos-query-frontend-rhobs",
Namespace: openshiftCustomerMonitoringNamespace,
Labels: map[string]string{
"app.kubernetes.io/component": "query-frontend",
"app.kubernetes.io/instance": "thanos-query-frontend-rhobs",
"app.kubernetes.io/managed-by": "thanos-operator",
"app.kubernetes.io/name": "thanos-query-frontend",
"app.kubernetes.io/part-of": "thanos",
"operator.thanos.io/owner": "rhobs",
"operator.thanos.io/query-api": "true",
},
},
Spec: monitoringv1.ServiceMonitorSpec{
Endpoints: []monitoringv1.Endpoint{
{
Interval: "30s",
Path: "/metrics",
Port: "http",
},
},
NamespaceSelector: monitoringv1.NamespaceSelector{
MatchNames: []string{namespace},
},
Selector: metav1.LabelSelector{
MatchLabels: map[string]string{
"app.kubernetes.io/component": "query-frontend",
"app.kubernetes.io/instance": "thanos-query-frontend-rhobs",
"app.kubernetes.io/managed-by": "thanos-operator",
"app.kubernetes.io/name": "thanos-query-frontend",
"app.kubernetes.io/part-of": "thanos",
"operator.thanos.io/owner": "rhobs",
},
},
},
},
&monitoringv1.ServiceMonitor{
TypeMeta: metav1.TypeMeta{
APIVersion: "monitoring.coreos.com/v1",
Expand Down
66 changes: 66 additions & 0 deletions resources/services/servicemonitors/production/servicemonitors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,31 @@ objects:
prometheus: app-sre
name: catch-all-compactor
namespace: openshift-customer-monitoring
spec:
endpoints:
- interval: 30s
path: /metrics
port: http
namespaceSelector:
matchNames:
- rhobs-production
selector:
matchLabels:
app.kubernetes.io/component: thanos-compactor
- apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: thanos-compactor
app.kubernetes.io/instance: thanos-compact-rhobs
app.kubernetes.io/managed-by: thanos-operator
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/part-of: thanos
operator.thanos.io/owner: rhobs
prometheus: app-sre
name: thanos-compact-rhobs
namespace: openshift-customer-monitoring
spec:
endpoints:
- interval: 30s
Expand All @@ -23,12 +48,22 @@ objects:
selector:
matchLabels:
app.kubernetes.io/component: thanos-compactor
app.kubernetes.io/instance: thanos-compact-rhobs
app.kubernetes.io/managed-by: thanos-operator
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/part-of: thanos
operator.thanos.io/owner: rhobs
- apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: thanos-compactor
app.kubernetes.io/instance: thanos-compact-telemeter
app.kubernetes.io/managed-by: thanos-operator
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/part-of: thanos
operator.thanos.io/owner: telemeter
prometheus: app-sre
name: thanos-compact-telemeter
namespace: openshift-customer-monitoring
Expand Down Expand Up @@ -78,6 +113,37 @@ objects:
selector:
matchLabels:
control-plane: controller-manager
- apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: query-frontend
app.kubernetes.io/instance: thanos-query-frontend-rhobs
app.kubernetes.io/managed-by: thanos-operator
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: thanos
operator.thanos.io/owner: rhobs
operator.thanos.io/query-api: "true"
prometheus: app-sre
name: thanos-query-frontend-rhobs
namespace: openshift-customer-monitoring
spec:
endpoints:
- interval: 30s
path: /metrics
port: http
namespaceSelector:
matchNames:
- rhobs-production
selector:
matchLabels:
app.kubernetes.io/component: query-frontend
app.kubernetes.io/instance: thanos-query-frontend-rhobs
app.kubernetes.io/managed-by: thanos-operator
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: thanos
operator.thanos.io/owner: rhobs
- apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down
31 changes: 31 additions & 0 deletions resources/services/servicemonitors/staging/servicemonitors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,37 @@ objects:
selector:
matchLabels:
control-plane: controller-manager
- apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: query-frontend
app.kubernetes.io/instance: thanos-query-frontend-rhobs
app.kubernetes.io/managed-by: thanos-operator
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: thanos
operator.thanos.io/owner: rhobs
operator.thanos.io/query-api: "true"
prometheus: app-sre
name: thanos-query-frontend-rhobs
namespace: openshift-customer-monitoring
spec:
endpoints:
- interval: 30s
path: /metrics
port: http
namespaceSelector:
matchNames:
- rhobs-stage
selector:
matchLabels:
app.kubernetes.io/component: query-frontend
app.kubernetes.io/instance: thanos-query-frontend-rhobs
app.kubernetes.io/managed-by: thanos-operator
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: thanos
operator.thanos.io/owner: rhobs
- apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down