Skip to content

Commit

Permalink
Add changes
Browse files Browse the repository at this point in the history
Signed-off-by: souravbiswassanto <[email protected]>
  • Loading branch information
souravbiswassanto committed Jan 24, 2024
1 parent 74d9ca5 commit 9bda436
Showing 1 changed file with 35 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@
"targets": [
{
"exemplar": true,
"expr": "time() - process_start_time_seconds{job=\"kubedb-databases\",namespace=\"demo\"}",
"expr": "time() - process_start_time_seconds{job=\"$app-stats\",namespace=\"demo\"}",
"interval": "",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
Expand Down Expand Up @@ -1033,7 +1033,7 @@
"targets": [
{
"exemplar": true,
"expr": "pg_up{job=\"kubedb-databases\",namespace=\"demo\"}",
"expr": "pg_up{job=\"$app-stats\",namespace=\"demo\"}",
"interval": "",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
Expand Down Expand Up @@ -1994,7 +1994,7 @@
"targets": [
{
"exemplar": false,
"expr": "sum(sum by (namespace, pod, container) (irate(container_cpu_usage_seconds_total{image!=\"\",job=\"kubernetes-nodes-cadvisor\",metrics_path=\"/metrics/cadvisor\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}[5m])) * on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}))) by (pod)",
"expr": "sum(sum by (namespace, pod, container) (irate(container_cpu_usage_seconds_total{image!=\"\",job=\"kubelet\",metrics_path=\"/metrics/cadvisor\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}[5m])) * on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}))) by (pod)",
"interval": "",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
Expand Down Expand Up @@ -2128,7 +2128,7 @@
"targets": [
{
"exemplar": true,
"expr": "sum(sum by (namespace, pod, container) (irate(container_cpu_usage_seconds_total{image!=\"\",job=\"kubernetes-nodes-cadvisor\",metrics_path=\"/metrics/cadvisor\",namespace=\"demo\", pod=~\"ha-postgres-\\\\d+$|ha-postgres-arbiter\\\\d+-\\\\d+$\"}[5m])) * on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\",namespace=\"demo\", pod=~\"ha-postgres-\\\\d+$|ha-postgres-arbiter\\\\d+-\\\\d+$\"}))) by (pod) / sum(kube_pod_container_resource_requests{job=\"kubernetes-service-endpoints\",resource=\"cpu\",namespace=\"demo\", pod=~\"ha-postgres-\\\\d+$|ha-postgres-arbiter\\\\d+-\\\\d+$\"} * on (namespace,pod) group_left () max by (namespace,pod) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"expr": "sum(sum by (namespace, pod, container) (irate(container_cpu_usage_seconds_total{image!=\"\",job=\"kubelet\",metrics_path=\"/metrics/cadvisor\",namespace=\"demo\", pod=~\"ha-postgres-\\\\d+$|ha-postgres-arbiter\\\\d+-\\\\d+$\"}[5m])) * on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\",namespace=\"demo\", pod=~\"ha-postgres-\\\\d+$|ha-postgres-arbiter\\\\d+-\\\\d+$\"}))) by (pod) / sum(kube_pod_container_resource_requests{job=\"kube-state-metrics\",resource=\"cpu\",namespace=\"demo\", pod=~\"ha-postgres-\\\\d+$|ha-postgres-arbiter\\\\d+-\\\\d+$\"} * on (namespace,pod) group_left () max by (namespace,pod) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"interval": "",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
Expand Down Expand Up @@ -2406,7 +2406,7 @@
"targets": [
{
"exemplar": false,
"expr": "sum(sum by (namespace, pod, container) (irate(container_cpu_usage_seconds_total{image!=\"\",job=\"kubernetes-nodes-cadvisor\",metrics_path=\"/metrics/cadvisor\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}[5m])) * on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}))) by (pod)",
"expr": "sum(sum by (namespace, pod, container) (irate(container_cpu_usage_seconds_total{image!=\"\",job=\"kubelet\",metrics_path=\"/metrics/cadvisor\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}[5m])) * on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}))) by (pod)",
"format": "table",
"instant": true,
"interval": "",
Expand All @@ -2417,7 +2417,7 @@
},
{
"exemplar": false,
"expr": "sum(kube_pod_container_resource_requests{job=\"kubernetes-service-endpoints\",resource=\"cpu\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"} * on (namespace,pod) group_left () max by (namespace,pod) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"expr": "sum(kube_pod_container_resource_requests{job=\"kube-state-metrics\",resource=\"cpu\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"} * on (namespace,pod) group_left () max by (namespace,pod) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"format": "table",
"instant": true,
"interval": "",
Expand All @@ -2428,7 +2428,7 @@
},
{
"exemplar": false,
"expr": "sum(sum by (namespace, pod, container) (irate(container_cpu_usage_seconds_total{image!=\"\",job=\"kubernetes-nodes-cadvisor\",metrics_path=\"/metrics/cadvisor\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}[5m])) * on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}))) by (pod) / sum(kube_pod_container_resource_requests{job=\"kubernetes-service-endpoints\",resource=\"cpu\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"} * on (namespace,pod) group_left () max by (namespace,pod) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"expr": "sum(sum by (namespace, pod, container) (irate(container_cpu_usage_seconds_total{image!=\"\",job=\"kubelet\",metrics_path=\"/metrics/cadvisor\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}[5m])) * on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}))) by (pod) / sum(kube_pod_container_resource_requests{job=\"kube-state-metrics\",resource=\"cpu\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"} * on (namespace,pod) group_left () max by (namespace,pod) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"format": "table",
"instant": true,
"interval": "",
Expand All @@ -2439,7 +2439,7 @@
},
{
"exemplar": false,
"expr": "sum(kube_pod_container_resource_limits{job=\"kubernetes-service-endpoints\",resource=\"cpu\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"} * on (namespace,pod) group_left() max by (namespace, pod) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"expr": "sum(kube_pod_container_resource_limits{job=\"kube-state-metrics\",resource=\"cpu\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"} * on (namespace,pod) group_left() max by (namespace, pod) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"format": "table",
"instant": true,
"interval": "",
Expand All @@ -2450,7 +2450,7 @@
},
{
"exemplar": false,
"expr": "sum(sum by (namespace, pod, container) (irate(container_cpu_usage_seconds_total{image!=\"\",job=\"kubernetes-nodes-cadvisor\",metrics_path=\"/metrics/cadvisor\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}[5m])) * on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}))) by (pod) / sum(kube_pod_container_resource_limits{job=\"kubernetes-service-endpoints\",resource=\"cpu\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"} * on (namespace,pod) group_left() max by (namespace, pod) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"expr": "sum(sum by (namespace, pod, container) (irate(container_cpu_usage_seconds_total{image!=\"\",job=\"kubelet\",metrics_path=\"/metrics/cadvisor\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}[5m])) * on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}))) by (pod) / sum(kube_pod_container_resource_limits{job=\"kube-state-metrics\",resource=\"cpu\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"} * on (namespace,pod) group_left() max by (namespace, pod) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"format": "table",
"instant": true,
"interval": "",
Expand Down Expand Up @@ -2548,7 +2548,7 @@
"targets": [
{
"exemplar": false,
"expr": "sum(container_memory_working_set_bytes{image!=\"\",job=\"kubernetes-nodes-cadvisor\",metrics_path=\"/metrics/cadvisor\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\",container!=\"\"} * on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\"}))) by (pod)",
"expr": "sum(container_memory_working_set_bytes{image!=\"\",job=\"kubelet\",metrics_path=\"/metrics/cadvisor\",namespace=\"$namespace\", pod=~\"$app-\\\\d+$\",container!=\"\"} * on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\"}))) by (pod)",
"interval": "",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
Expand Down Expand Up @@ -2896,7 +2896,7 @@
},
{
"exemplar": false,
"expr": "sum (kube_pod_container_resource_requests{job=\"kubernetes-service-endpoints\",resource=\"memory\",namespace=\"$namespace\",pod=~\"$app-\\\\d+$\"} * on (namespace, pod, cluster) group_left () max by (namespace, pod, cluster) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"expr": "sum (kube_pod_container_resource_requests{job=\"kube-state-metrics\",resource=\"memory\",namespace=\"$namespace\",pod=~\"$app-\\\\d+$\"} * on (namespace, pod, cluster) group_left () max by (namespace, pod, cluster) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"format": "table",
"instant": true,
"interval": "",
Expand All @@ -2907,7 +2907,7 @@
},
{
"exemplar": false,
"expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\",pod=~\"$app-\\\\d+$\",container!=\"\", image!=\"\"}) by (pod) / sum(kube_pod_container_resource_requests{job=\"kubernetes-service-endpoints\",resource=\"memory\",namespace=\"$namespace\",pod=~\"$app-\\\\d+$\"} * on (namespace, pod, cluster) group_left () max by (namespace, pod, cluster) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\",pod=~\"$app-\\\\d+$\",container!=\"\", image!=\"\"}) by (pod) / sum(kube_pod_container_resource_requests{job=\"kube-state-metrics\",resource=\"memory\",namespace=\"$namespace\",pod=~\"$app-\\\\d+$\"} * on (namespace, pod, cluster) group_left () max by (namespace, pod, cluster) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"format": "table",
"instant": true,
"interval": "",
Expand All @@ -2918,7 +2918,7 @@
},
{
"exemplar": false,
"expr": "sum(kube_pod_container_resource_limits{job=\"kubernetes-service-endpoints\",resource=\"memory\",namespace=\"$namespace\",pod=~\"$app-\\\\d+$\"} * on (namespace, pod, cluster) group_left () max by (namespace, pod, cluster) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"expr": "sum(kube_pod_container_resource_limits{job=\"kube-state-metrics\",resource=\"memory\",namespace=\"$namespace\",pod=~\"$app-\\\\d+$\"} * on (namespace, pod, cluster) group_left () max by (namespace, pod, cluster) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"format": "table",
"instant": true,
"interval": "",
Expand All @@ -2929,7 +2929,7 @@
},
{
"exemplar": false,
"expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\",pod=~\"$app-\\\\d+$\",container!=\"\", image!=\"\"}) by (pod) / sum(kube_pod_container_resource_limits{job=\"kubernetes-service-endpoints\",resource=\"memory\",namespace=\"$namespace\",pod=~\"$app-\\\\d+$\"} * on (namespace, pod, cluster) group_left () max by (namespace, pod, cluster) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\",pod=~\"$app-\\\\d+$\",container!=\"\", image!=\"\"}) by (pod) / sum(kube_pod_container_resource_limits{job=\"kube-state-metrics\",resource=\"memory\",namespace=\"$namespace\",pod=~\"$app-\\\\d+$\"} * on (namespace, pod, cluster) group_left () max by (namespace, pod, cluster) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"format": "table",
"instant": true,
"interval": "",
Expand Down Expand Up @@ -3072,7 +3072,7 @@
"targets": [
{
"exemplar": true,
"expr": "sum(container_memory_working_set_bytes{namespace=\"demo\",pod=~\"ha-postgres-\\\\d+$|ha-postgres-arbiter\\\\d+-\\\\d+$\",container!=\"\", image!=\"\"}) by (pod) / sum(kube_pod_container_resource_requests{job=\"kubernetes-service-endpoints\",resource=\"memory\",namespace=\"demo\",pod=~\"ha-postgres-\\\\d+$|ha-postgres-arbiter\\\\d+-\\\\d+$\"} * on (namespace, pod, cluster) group_left () max by (namespace, pod, cluster) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"expr": "sum(container_memory_working_set_bytes{namespace=\"demo\",pod=~\"ha-postgres-\\\\d+$|ha-postgres-arbiter\\\\d+-\\\\d+$\",container!=\"\", image!=\"\"}) by (pod) / sum(kube_pod_container_resource_requests{job=\"kube-state-metrics\",resource=\"memory\",namespace=\"demo\",pod=~\"ha-postgres-\\\\d+$|ha-postgres-arbiter\\\\d+-\\\\d+$\"} * on (namespace, pod, cluster) group_left () max by (namespace, pod, cluster) ((kube_pod_status_phase{phase=~\"Pending|Running\"} == 1))) by (pod)",
"interval": "",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
Expand Down Expand Up @@ -4539,8 +4539,8 @@
"align": false,
"alignLevel": null
}
},
{{- if $alerts }}
}
{{- if $alerts }},
{
"alert": {
"alertRuleTags": {},
Expand Down Expand Up @@ -4619,7 +4619,7 @@
"targets": [
{
"exemplar": true,
"expr": "pg_exporter_last_scrape_error{job=\"kubedb-databases\",namespace=\"demo\"}",
"expr": "pg_exporter_last_scrape_error{job=\"$app-stats\",namespace=\"demo\"}",
"interval": "",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
Expand Down Expand Up @@ -4782,7 +4782,7 @@
"targets": [
{
"exemplar": true,
"expr": "rate(pg_stat_database_xact_rollback{job=\"kubedb-databases\",namespace=\"demo\"}[3m]) / rate(pg_stat_database_xact_commit{job=\"kubedb-databases\",namespace=\"demo\"}[3m])",
"expr": "rate(pg_stat_database_xact_rollback{job=\"$app-stats\",namespace=\"demo\"}[3m]) / rate(pg_stat_database_xact_commit{job=\"$app-stats\",namespace=\"demo\"}[3m])",
"interval": "",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
Expand Down Expand Up @@ -4877,7 +4877,7 @@
"targets": [
{
"exemplar": true,
"expr": "sum by (pod) (pg_stat_activity_count{job=\"kubedb-databases\",namespace=\"demo\"}) - sum by (pod) (pg_settings_max_connections{job=\"kubedb-databases\",namespace=\"demo\"} * 80) / 100",
"expr": "sum by (pod) (pg_stat_activity_count{job=\"$app-stats\",namespace=\"demo\"}) - sum by (pod) (pg_settings_max_connections{job=\"$app-stats\",namespace=\"demo\"} * 80) / 100",
"interval": "",
"legendFormat": {{ `"{{postgres}}"` }},
"refId": "A"
Expand Down Expand Up @@ -5011,7 +5011,7 @@
"targets": [
{
"exemplar": true,
"expr": "((sum by (pod) (pg_locks_count{job=\"kubedb-databases\",namespace=\"demo\"})) / (sum by (pod) (pg_settings_max_locks_per_transaction{job=\"kubedb-databases\",namespace=\"demo\"}) * sum by (pod) (pg_settings_max_connections{job=\"kubedb-databases\",namespace=\"demo\"})))",
"expr": "((sum by (pod) (pg_locks_count{job=\"$app-stats\",namespace=\"demo\"})) / (sum by (pod) (pg_settings_max_locks_per_transaction{job=\"$app-stats\",namespace=\"demo\"}) * sum by (pod) (pg_settings_max_connections{job=\"$app-stats\",namespace=\"demo\"})))",
"interval": "",
"legendFormat": {{ `"{{postgres}}"` }},
"refId": "A"
Expand Down Expand Up @@ -5109,7 +5109,7 @@
"text": "demo",
"value": "demo"
},
"datasource": null,
"datasource": "${datasource}",
"definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
Expand All @@ -5119,10 +5119,16 @@
"multi": false,
"name": "namespace",
"options": [],
{{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
"type": "query",
{{- else }}
"query": {{ $.Values.app.namespace | quote }},
"type": "constant",
{{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand All @@ -5139,7 +5145,7 @@
"text": "ha-postgres",
"value": "ha-postgres"
},
"datasource": null,
"datasource": "${datasource}",
"definition": "query_result(kubedb_com_postgres_created{namespace=\"$namespace\"})",
"description": null,
"error": null,
Expand All @@ -5149,10 +5155,16 @@
"multi": false,
"name": "app",
"options": [],
{{- if $shared }}
"query": {
"query": "query_result(kubedb_com_postgres_created{namespace=\"$namespace\"})",
"refId": "Prometheus-app-Variable-Query"
},
"type": "query",
{{- else }}
"query": {{ $.Values.app.name | quote }},
"type": "constant",
{{- end }}
"refresh": 1,
"regex": "/.*app=\"([^\"]+).*/",
"skipUrlSync": false,
Expand Down

0 comments on commit 9bda436

Please sign in to comment.