diff --git a/component/monitoring.libsonnet b/component/monitoring.libsonnet index 56c0067f..c5d9e62c 100644 --- a/component/monitoring.libsonnet +++ b/component/monitoring.libsonnet @@ -104,8 +104,10 @@ local promEnable = function(obj) ; [ - promEnable(serviceMonitor('syn-argocd-metrics')), - promEnable(serviceMonitor('syn-argocd-server-metrics')), - promEnable(serviceMonitor('syn-argocd-repo-server')), + // We explicitly select names for the service monitors which don't match the + // operator-generated names for instance syn-argocd + promEnable(serviceMonitor('syn-component-argocd-metrics')), + promEnable(serviceMonitor('syn-component-argocd-server-metrics')), + promEnable(serviceMonitor('syn-component-argocd-repo-server')), promEnable(alert_rules), ] + if params.monitoring.dashboards then [ grafana_dashboard ] else [] diff --git a/tests/golden/defaults/argocd/argocd/01_namespace/20_monitoring.yaml b/tests/golden/defaults/argocd/argocd/01_namespace/20_monitoring.yaml index 8448e9f1..2510b0a8 100644 --- a/tests/golden/defaults/argocd/argocd/01_namespace/20_monitoring.yaml +++ b/tests/golden/defaults/argocd/argocd/01_namespace/20_monitoring.yaml @@ -3,18 +3,18 @@ kind: ServiceMonitor metadata: annotations: {} labels: - app.kubernetes.io/name: syn-argocd-metrics + app.kubernetes.io/name: syn-component-argocd-metrics app.kubernetes.io/part-of: argocd monitoring.syn.tools/enabled: 'true' - name: syn-argocd-metrics - name: syn-argocd-metrics + name: syn-component-argocd-metrics + name: syn-component-argocd-metrics namespace: syn spec: endpoints: - port: metrics selector: matchLabels: - app.kubernetes.io/name: syn-argocd-metrics + app.kubernetes.io/name: syn-component-argocd-metrics app.kubernetes.io/part-of: argocd --- apiVersion: monitoring.coreos.com/v1 @@ -22,18 +22,18 @@ kind: ServiceMonitor metadata: annotations: {} labels: - app.kubernetes.io/name: syn-argocd-server-metrics + app.kubernetes.io/name: syn-component-argocd-server-metrics app.kubernetes.io/part-of: argocd monitoring.syn.tools/enabled: 'true' - name: syn-argocd-server-metrics - name: syn-argocd-server-metrics + name: syn-component-argocd-server-metrics + name: syn-component-argocd-server-metrics namespace: syn spec: endpoints: - port: metrics selector: matchLabels: - app.kubernetes.io/name: syn-argocd-server-metrics + app.kubernetes.io/name: syn-component-argocd-server-metrics app.kubernetes.io/part-of: argocd --- apiVersion: monitoring.coreos.com/v1 @@ -41,18 +41,18 @@ kind: ServiceMonitor metadata: annotations: {} labels: - app.kubernetes.io/name: syn-argocd-repo-server + app.kubernetes.io/name: syn-component-argocd-repo-server app.kubernetes.io/part-of: argocd monitoring.syn.tools/enabled: 'true' - name: syn-argocd-repo-server - name: syn-argocd-repo-server + name: syn-component-argocd-repo-server + name: syn-component-argocd-repo-server namespace: syn spec: endpoints: - port: metrics selector: matchLabels: - app.kubernetes.io/name: syn-argocd-repo-server + app.kubernetes.io/name: syn-component-argocd-repo-server app.kubernetes.io/part-of: argocd --- apiVersion: monitoring.coreos.com/v1 diff --git a/tests/golden/openshift/argocd/argocd/01_namespace/20_monitoring.yaml b/tests/golden/openshift/argocd/argocd/01_namespace/20_monitoring.yaml index 8448e9f1..2510b0a8 100644 --- a/tests/golden/openshift/argocd/argocd/01_namespace/20_monitoring.yaml +++ b/tests/golden/openshift/argocd/argocd/01_namespace/20_monitoring.yaml @@ -3,18 +3,18 @@ kind: ServiceMonitor metadata: annotations: {} labels: - app.kubernetes.io/name: syn-argocd-metrics + app.kubernetes.io/name: syn-component-argocd-metrics app.kubernetes.io/part-of: argocd monitoring.syn.tools/enabled: 'true' - name: syn-argocd-metrics - name: syn-argocd-metrics + name: syn-component-argocd-metrics + name: syn-component-argocd-metrics namespace: syn spec: endpoints: - port: metrics selector: matchLabels: - app.kubernetes.io/name: syn-argocd-metrics + app.kubernetes.io/name: syn-component-argocd-metrics app.kubernetes.io/part-of: argocd --- apiVersion: monitoring.coreos.com/v1 @@ -22,18 +22,18 @@ kind: ServiceMonitor metadata: annotations: {} labels: - app.kubernetes.io/name: syn-argocd-server-metrics + app.kubernetes.io/name: syn-component-argocd-server-metrics app.kubernetes.io/part-of: argocd monitoring.syn.tools/enabled: 'true' - name: syn-argocd-server-metrics - name: syn-argocd-server-metrics + name: syn-component-argocd-server-metrics + name: syn-component-argocd-server-metrics namespace: syn spec: endpoints: - port: metrics selector: matchLabels: - app.kubernetes.io/name: syn-argocd-server-metrics + app.kubernetes.io/name: syn-component-argocd-server-metrics app.kubernetes.io/part-of: argocd --- apiVersion: monitoring.coreos.com/v1 @@ -41,18 +41,18 @@ kind: ServiceMonitor metadata: annotations: {} labels: - app.kubernetes.io/name: syn-argocd-repo-server + app.kubernetes.io/name: syn-component-argocd-repo-server app.kubernetes.io/part-of: argocd monitoring.syn.tools/enabled: 'true' - name: syn-argocd-repo-server - name: syn-argocd-repo-server + name: syn-component-argocd-repo-server + name: syn-component-argocd-repo-server namespace: syn spec: endpoints: - port: metrics selector: matchLabels: - app.kubernetes.io/name: syn-argocd-repo-server + app.kubernetes.io/name: syn-component-argocd-repo-server app.kubernetes.io/part-of: argocd --- apiVersion: monitoring.coreos.com/v1 diff --git a/tests/golden/params/argocd/argocd/01_namespace/20_monitoring.yaml b/tests/golden/params/argocd/argocd/01_namespace/20_monitoring.yaml index c675a8f2..e72b0372 100644 --- a/tests/golden/params/argocd/argocd/01_namespace/20_monitoring.yaml +++ b/tests/golden/params/argocd/argocd/01_namespace/20_monitoring.yaml @@ -3,17 +3,17 @@ kind: ServiceMonitor metadata: annotations: {} labels: - app.kubernetes.io/name: syn-argocd-metrics + app.kubernetes.io/name: syn-component-argocd-metrics app.kubernetes.io/part-of: argocd - name: syn-argocd-metrics - name: syn-argocd-metrics + name: syn-component-argocd-metrics + name: syn-component-argocd-metrics namespace: syn spec: endpoints: - port: metrics selector: matchLabels: - app.kubernetes.io/name: syn-argocd-metrics + app.kubernetes.io/name: syn-component-argocd-metrics app.kubernetes.io/part-of: argocd --- apiVersion: monitoring.coreos.com/v1 @@ -21,17 +21,17 @@ kind: ServiceMonitor metadata: annotations: {} labels: - app.kubernetes.io/name: syn-argocd-server-metrics + app.kubernetes.io/name: syn-component-argocd-server-metrics app.kubernetes.io/part-of: argocd - name: syn-argocd-server-metrics - name: syn-argocd-server-metrics + name: syn-component-argocd-server-metrics + name: syn-component-argocd-server-metrics namespace: syn spec: endpoints: - port: metrics selector: matchLabels: - app.kubernetes.io/name: syn-argocd-server-metrics + app.kubernetes.io/name: syn-component-argocd-server-metrics app.kubernetes.io/part-of: argocd --- apiVersion: monitoring.coreos.com/v1 @@ -39,17 +39,17 @@ kind: ServiceMonitor metadata: annotations: {} labels: - app.kubernetes.io/name: syn-argocd-repo-server + app.kubernetes.io/name: syn-component-argocd-repo-server app.kubernetes.io/part-of: argocd - name: syn-argocd-repo-server - name: syn-argocd-repo-server + name: syn-component-argocd-repo-server + name: syn-component-argocd-repo-server namespace: syn spec: endpoints: - port: metrics selector: matchLabels: - app.kubernetes.io/name: syn-argocd-repo-server + app.kubernetes.io/name: syn-component-argocd-repo-server app.kubernetes.io/part-of: argocd --- apiVersion: monitoring.coreos.com/v1