Skip to content

Commit

Permalink
chore(mission-control): add cpu/memory property in component cards
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra authored and moshloop committed Dec 26, 2024
1 parent 93cb59b commit 98b60b5
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions charts/mission-control/templates/mission-control.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ spec:
display:
expr: config.spec.rules[0].host
components:

# Incident commander
- components:
- icon: group
lookup:
Expand Down Expand Up @@ -86,6 +88,29 @@ spec:
query: SELECT count(*) FROM incidents WHERE (resolved IS NULL) OR (closed
IS NULL)
results: 1
- lookup:
postgres:
- connection: "connection://{{ .Values.connectionName }}"
display:
expr: results.rows[0].props
name: Incident commander pod usage query
query: |
SELECT
jsonb_agg(property) AS props
FROM (
SELECT
jsonb_array_elements(properties) AS property
FROM components
WHERE
name LIKE 'mission-control-%'
AND type = 'Kubernetes::Pod'
AND status = 'Running'
AND deleted_at IS NULL
AND agent_id = '00000000-0000-0000-0000-000000000000'
ORDER BY created_at desc
) sub
WHERE property->>'name' IN ('memory', 'cpu') LIMIT 1;
name: Incidents
- name: Docs
text: https://docs.flanksource.com
Expand Down Expand Up @@ -232,6 +257,29 @@ spec:
- name: Docs
text: https://docs.flanksource.com/canary-checker/overview
type: url
- lookup:
postgres:
- connection: "connection://{{ .Values.connectionName }}"
display:
expr: results.rows[0].props
name: Canary checker pod usage query
query: |
SELECT
jsonb_agg(property) AS props
FROM (
SELECT
jsonb_array_elements(properties) AS property
FROM components
WHERE
name LIKE 'canary-checker-%'
AND type = 'Kubernetes::Pod'
AND status = 'Running'
AND deleted_at IS NULL
AND agent_id = '00000000-0000-0000-0000-000000000000'
ORDER BY created_at desc
) sub
WHERE property->>'name' IN ('memory', 'cpu') LIMIT 1;
selectors:
- labelSelector: app.kubernetes.io/name=canary-checker
type: API
Expand Down Expand Up @@ -383,6 +431,29 @@ spec:
- name: Docs
text: https://docs.flanksource.com/config-db/overview
type: url
- lookup:
postgres:
- connection: "connection://{{ .Values.connectionName }}"
display:
expr: results.rows[0].props
name: Config DB pod usage query
query: |
SELECT
jsonb_agg(property) AS props
FROM (
SELECT
jsonb_array_elements(properties) AS property
FROM components
WHERE
name LIKE 'config-db-%'
AND type = 'Kubernetes::Pod'
AND status = 'Running'
AND deleted_at IS NULL
AND agent_id = '00000000-0000-0000-0000-000000000000'
ORDER BY created_at desc
) sub
WHERE property->>'name' IN ('memory', 'cpu') LIMIT 1;
selectors:
- labelSelector: app.kubernetes.io/name=config-db
type: API
Expand Down

0 comments on commit 98b60b5

Please sign in to comment.