From 8f348b3fe71fcb690936785148909102f23061de Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Mon, 4 Dec 2023 10:54:45 +0530 Subject: [PATCH] chore: add check execution interval to properties and use default prometheus url --- chart/templates/topology.yaml | 43 +++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/chart/templates/topology.yaml b/chart/templates/topology.yaml index bdba3c54..2e6c0b5f 100644 --- a/chart/templates/topology.yaml +++ b/chart/templates/topology.yaml @@ -43,7 +43,6 @@ spec: lookup: prometheus: - query: '1000 * max(rate(container_cpu_usage_seconds_total{container!="",namespace="{{ .Release.Namespace}}"}[5m]))' - url: 'http://prometheus-k8s.monitoring:9090' display: expr: | [{'name': 'CPU', 'value': int(results[0].value), 'headline': true, 'unit': 'millicores'}].toJSON() @@ -51,12 +50,20 @@ spec: lookup: prometheus: - query: 'max(avg_over_time(container_memory_working_set_bytes{container!="",namespace="{{ .Release.Namespace}}"}[5m]))' - url: 'http://prometheus-k8s.monitoring:9090' display: expr: | [{'name': 'Memory', 'value': int(results[0].value), 'headline': true, 'unit': 'bytes'}].toJSON() - name: Org ID text: {{ .Values.missionControl.clerkOrgID }} + - name: Last Login + lookup: + postgres: + - connection: connection://postgres/mission-control + query: SELECT MAX(last_login) FROM people + display: + expr: results.rows[0].max + - name: Namespace + text: {{ .Release.Namespace }} components: - components: - icon: group @@ -120,7 +127,7 @@ spec: - forEach: properties: - name: Type - text: SystemTemplate + text: Topology icon: k8s-customresourcedefinition lookup: postgres: @@ -174,15 +181,37 @@ spec: name: Component count query query: SELECT count(*) FROM components WHERE deleted_at IS NULL name: Components - - headline: true + - name: Checks + headline: true lookup: postgres: - connection: connection://postgres/mission-control display: - javascript: results.rows[0].count - name: Check count query + expr: results.rows[0].count query: SELECT COUNT(*) FROM checks WHERE deleted_at IS NULL - name: Checks + - name: Canaries + headline: true + lookup: + postgres: + - connection: connection://postgres/mission-control + display: + expr: results.rows[0].count + query: SELECT COUNT(*) FROM canaries WHERE deleted_at IS NULL + - name: Check Executions / Hour + lookup: + postgres: + - connection: connection://postgres/mission-control + display: + expr: results.rows[0].count + query: SELECT COUNT(*)/(30*24) FROM check_statuses WHERE (NOW() - created_at) > INTERVAL '30 days' + - name: Check Executions / Day + lookup: + postgres: + - connection: connection://postgres/mission-control + query: SELECT COUNT(*)/30 FROM check_statuses WHERE (NOW() - created_at) > INTERVAL '30 days' + display: + expr: results.rows[0].count + - name: Docs text: https://docs.flanksource.com/canary-checker/overview type: url