Skip to content

Commit

Permalink
chore: add check execution interval to properties and use default pro…
Browse files Browse the repository at this point in the history
…metheus url
  • Loading branch information
yashmehrotra committed Dec 4, 2023
1 parent 5673ab6 commit 8f348b3
Showing 1 changed file with 36 additions and 7 deletions.
43 changes: 36 additions & 7 deletions chart/templates/topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,27 @@ 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()
- name: Memory
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
Expand Down Expand Up @@ -120,7 +127,7 @@ spec:
- forEach:
properties:
- name: Type
text: SystemTemplate
text: Topology
icon: k8s-customresourcedefinition
lookup:
postgres:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8f348b3

Please sign in to comment.