-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated code to run queries and anaylyze results, using goroutines, c…
…hannels for concurrency. Signed-off-by: Kedar Vijay Kulkarni <[email protected]>
- Loading branch information
Kedar Vijay Kulkarni
committed
Nov 3, 2021
1 parent
2c7d3a4
commit b88950c
Showing
6 changed files
with
153 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
# You can also set these or program will try to fetch this dynamically from OpenShift | ||
# as long as KUBECONFIG is set | ||
URL: # Use the public Route to prometheus | ||
BearerToken: | ||
url: # Use the public Route to prometheus | ||
bearerToken: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,63 @@ | ||
--- | ||
- query: "sum(kube_pod_status_phase{}) by (phase) > 0" | ||
watchFor: | ||
- key: Phase | ||
watchFor: # watchFor will have only multiple value for status/count queries | ||
- key: phase | ||
val: "Pending" | ||
threshold: 10 | ||
- key: Phase | ||
operator: lte | ||
- key: phase | ||
val: "Failed" | ||
threshold: 0 | ||
operator: eq | ||
- key: phase | ||
val: "Succeeded" | ||
threshold: 77 | ||
operator: gte | ||
- query: "sum(kube_namespace_status_phase) by (phase)" | ||
watchFor: | ||
- key: Phase | ||
- key: phase | ||
val: "Terminating" | ||
threshold: 0 | ||
|
||
operator: eq | ||
- query: 'max(sum by (instance) (rate(ovnkube_master_pod_creation_latency_seconds_sum[20m])))' # Pod annoation latency | ||
watchFor: # watchFor will have only 1 value for latency/duration queries | ||
- key: nil | ||
val: nil | ||
threshold: 0.02 | ||
operator: lt | ||
- query: 'max(sum by (instance) (rate(ovnkube_node_cni_request_duration_seconds_sum{command="ADD"}[20m])))' # CNI Request duration for "ADD" command over 2m interval | ||
watchFor: | ||
- key: nil | ||
val: nil | ||
threshold: 0.1 | ||
operator: lt | ||
- query: 'max(sum by (instance) (rate(ovnkube_node_cni_request_duration_seconds_sum{command="DEL"}[20m])))' # CNI Request duration for "DEL" command over 2m interval | ||
watchFor: | ||
- key: nil | ||
val: nil | ||
threshold: 0.02 | ||
operator: lt | ||
- query: 'max(sum(container_memory_working_set_bytes{pod=~"ovnkube-master-.*",namespace="openshift-ovn-kubernetes",container=""}) by (node))' | ||
watchFor: | ||
- key: nil | ||
val: nil | ||
threshold: 209715200 | ||
operator: lt | ||
- query: 'max(sum(container_memory_rss{namespace!="",name!="",container="prometheus"}) by (pod))/1073742000' # 1073742000 is bytes per GiB | ||
watchFor: | ||
- key: nil | ||
val: nil | ||
threshold: 2 # GiB | ||
operator: lt | ||
# - query: 'topk(10, rate(container_cpu_usage_seconds_total{pod=~"ovnkube-.*",namespace="openshift-ovn-kubernetes",container="ovn-controller"}[2m])*100)' # top 10 - ovn-controller cpu usage | ||
# watchFor: | ||
# - query: 'topk(10, sum(container_memory_working_set_bytes{pod=~"ovnkube-node-.*",namespace="openshift-ovn-kubernetes",container="ovn-controller"}) by (node))' # top 10 - ovn-controller memory usage | ||
# watchFor: | ||
# - query: 'sum(container_memory_rss{pod="prometheus-k8s-0",namespace!="",name!="",container="prometheus"}) by (pod)' # Prometheus replica 0 rss memory | ||
# watchFor: | ||
# - query: 'sum(container_memory_rss{pod="prometheus-k8s-1",namespace!="",name!="",container="prometheus"}) by (pod)' # Prometheus replica 1 rss memory | ||
# watchFor: | ||
# - query: 'rate(container_cpu_usage_seconds_total{pod=~"ovnkube-master.*",namespace="openshift-ovn-kubernetes",container!=""}[2m])*100' # CPU usage ovnkube-master components over 2m interval | ||
# watchFor: | ||
# - query: 'sum by (condition)(cluster_operator_conditions{condition!=""})' | ||
# watchFor: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters