Skip to content

Commit

Permalink
Merge pull request #1451 from flanksource/fix-k8s-system-cluster-query
Browse files Browse the repository at this point in the history
fix: k8s cluster prometheus query for topology
  • Loading branch information
moshloop authored Nov 20, 2023
2 parents e88dc24 + 4c51349 commit 477cfa0
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions fixtures/topology/k8s-system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ spec:
- name: cpu
lookup:
prometheus:
- query: '1000 * max(rate(container_cpu_usage_seconds_total{container!=""}[5m]))'
- query: 'sum(1000 * max by (node) (rate(container_cpu_usage_seconds_total{container!=""}[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!=""}[5m]))'
- query: 'sum(max by (node) (avg_over_time(container_memory_working_set_bytes{container!=""}[5m])))'
url: 'http://prometheus-k8s.monitoring:9090'
display:
expr: |
Expand All @@ -38,19 +38,6 @@ spec:
id:
javascript: properties.zone + "/" + self.name
type: KubernetesNode
configs:
- name: flanksource-canary-cluster
type: EKS
# properties:
# - name: cluster-name
# configLookup:
# display:
# javascript: findConfigItem("EKS", "flanksource-canary-cluster")["name"]
# - name: cluster-status
# configLookup:
# display:
# javascript: getConfigItems("EKS")[0]["spec"]["status"]

components:
- name: NodesGroup
type: virtual
Expand Down Expand Up @@ -145,4 +132,3 @@ spec:
})
}
JSON.stringify(components)

0 comments on commit 477cfa0

Please sign in to comment.