Skip to content

Commit

Permalink
added attribute to specify dashboards
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhuth committed Oct 18, 2024
1 parent 6854537 commit 0ae4cd3
Show file tree
Hide file tree
Showing 5 changed files with 302 additions and 294 deletions.
4 changes: 2 additions & 2 deletions charts/argocd-metrics-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: argocd-metrics-server
description: A Helm chart for installing the Argo CD Metrics Server, which connects to Prometheus and can be used to display Metrics in the Argo CD UI
type: application
version: 1.0.0
version: 1.0.1
appVersion: "v1.0.3"
home: https://github.com/christianhuth/helm-charts
icon: https://icon.icepanel.io/Technology/svg/Argo-CD.svg
Expand All @@ -14,7 +14,7 @@ sources:
annotations:
artifacthub.io/changes: |
- kind: added
description: Initial Commit
description: attribute (prometheus.dashboards) for specifying your own dashboards
artifacthub.io/signKey: |
fingerprint: EE24F8BB6D099E78FD704F83B5ECDBCDDD485D0E
url: https://charts.christianhuth.de/public.key
1 change: 1 addition & 0 deletions charts/argocd-metrics-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The command removes all the Kubernetes components associated with the chart and
| networkPolicy.prometheus.podSelector | object | `{"app.kubernetes.io/name":"prometheus"}` | The labels of the Prometheus Pods |
| nodeSelector | object | `{}` | Node labels for pod assignment |
| podSecurityContext | object | `{}` | pod-level security context |
| prometheus.dashboards | string | see [values.yaml](./values.yaml) | The dashboards that will be displayed in the Argo CD UI |
| prometheus.namespace | string | `"monitoring"` | The namespace where Prometheus is running |
| prometheus.port | int | `9090` | The port on which the Prometheus service is listening for traffic |
| prometheus.service | string | `"prometheus-operated"` | The name of the Prometheus service |
Expand Down
305 changes: 13 additions & 292 deletions charts/argocd-metrics-server/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,300 +9,21 @@ metadata:
data:
config.json: |
{
"prometheus": {
"applications": [
"prometheus": {
"applications": [
{
"name": "default",
"default": true,
"dashboards": [
{{- .Values.prometheus.dashboards | nindent 14 }}
]
}
],
"provider":
{
"name": "default",
"Name": "default",
"default": true,
"dashboards": [
{
"groupKind": "pod",
"tabs": ["Golden Signal"],
"rows": [
{
"name": "pod",
"title": "Pods",
"tab": "Golden Signal",
"graphs": [
{
"name": "pod_cpu_line",
"title": "CPU",
"description": "",
"graphType": "line",
"metricName": "pod",
"queryExpression": "sum(rate(container_cpu_usage_seconds_total{pod=~\"{{"{{"}}.name{{"}}"}}\", image!=\"\", container!=\"POD\", container!=\"\", container_name!=\"POD\"}[5m])) by (pod)"
},
{
"name": "pod_cpu_pie",
"title": "CPU Avg",
"description": "",
"graphType": "pie",
"metricName": "pod",
"queryExpression": "sum(rate(container_cpu_usage_seconds_total{pod=~\"{{"{{"}}.name{{"}}"}}\", container!=\"POD\", image!=\"\", container!=\"\", container_name!=\"POD\"}[5m])) by (pod)"
},
{
"name": "pod_memory_line",
"title": "Memory",
"description": "",
"graphType": "line",
"metricName": "pod",
"queryExpression": "sum(rate(container_memory_usage_bytes{pod=~\"{{"{{"}}.name{{"}}"}}\", container!=\"POD\", image!=\"\", container!=\"\", container_name!=\"POD\"}[5m])) by (pod)"
},
{
"name": "pod_memory_pie",
"title": "Mem Avg",
"description": "",
"graphType": "pie",
"metricName": "pod",
"queryExpression": "sum(rate(container_memory_usage_bytes{pod=~\"{{"{{"}}.name{{"}}"}}\", container!=\"POD\", image!=\"\", container!=\"\", container_name!=\"POD\"}[5m])) by (pod)"
}
]
},
{
"name": "container",
"title": "Containers",
"tab": "Golden Signal",
"graphs": [
{
"name": "container_cpu_line",
"title": "CPU",
"description": "",
"graphType": "line",
"metricName": "container",
"queryExpression": "sum(rate(container_cpu_usage_seconds_total{pod=~\"{{"{{"}}.name{{"}}"}}\", image!=\"\", container!=\"POD\", container!=\"\", container_name!=\"POD\"}[5m])) by (container)"
},
{
"name": "container_cpu_pie",
"title": "CPU Avg",
"description": "",
"graphType": "pie",
"metricName": "container",
"queryExpression": "sum(rate(container_cpu_usage_seconds_total{pod=~\"{{"{{"}}.name{{"}}"}}\", image!=\"\",container!=\"POD\", container!=\"\", container_name!=\"POD\"}[5m])) by (container)"
},
{
"name": "container_memory_line",
"title": "Memory",
"description": "",
"graphType": "line",
"metricName": "container",
"queryExpression": "sum(rate(container_memory_usage_bytes{pod=~\"{{"{{"}}.name{{"}}"}}\", image!=\"\", container!=\"POD\", container!=\"\", container_name!=\"POD\"}[5m])) by (container)"
},
{
"name": "container_memory_pie",
"title": "Mem Avg",
"description": "",
"graphType": "pie",
"metricName": "container",
"queryExpression": "sum(rate(container_memory_usage_bytes{pod=~\"{{"{{"}}.name{{"}}"}}\", image!=\"\", container!=\"POD\", container!=\"\", container_name!=\"POD\"}[5m])) by (container)"
}
]
}
]
},
{
"groupKind": "deployment",
"tabs": ["Golden Signal"],
"rows": [
{
"name": "httplatency",
"title": "HTTP Latency",
"tab": "Golden Signal",
"graphs": [
{
"name": "http_200_latency",
"title": "Latency",
"description": "",
"graphType": "line",
"metricName": "pod_template_hash",
"queryExpression": "sum(rate(http_server_requests_seconds_sum {namespace=\"{{"{{"}}.namespace{{"}}"}}\", status=\"200\"} [1m])) by (pod_template_hash)"
}
]
},
{
"name": "httperrortate",
"title": "HTTP Error Rate",
"tab": "Golden Signal",
"graphs": [
{
"name": "http_error_rate_500",
"title": "HTTP Error 500",
"description": "",
"graphType": "line",
"metricName": "pod_template_hash",
"queryExpression": "sum(rate(http_server_requests_seconds_count {namespace=\"{{"{{"}}.namespace{{"}}"}}\", status=\"500\"} [1m])) by (pod_template_hash)"
},
{
"name": "http_error_rate_400",
"title": "HTTP Error 400",
"description": "",
"graphType": "line",
"metricName": "pod_template_hash",
"queryExpression": "sum(rate(http_server_requests_seconds_count {namespace=\"{{"{{"}}.namespace{{"}}"}}\", status=\"404\"} [1m])) by (pod_template_hash)"
}
]
},
{
"name": "httptraffic",
"title": "HTTP Traffic",
"tab": "Golden Signal",
"graphs": [
{
"name": "http_traffic",
"title": "Traffic",
"description": "",
"graphType": "line",
"metricName": "pod_template_hash",
"queryExpression": "sum(rate(http_server_requests_seconds_count {namespace=\"{{"{{"}}.namespace{{"}}"}}\"} [1m])) by (pod_template_hash)"
}
]
},
{
"name": "pod",
"title": "Pods",
"tab": "Golden Signal",
"graphs": [
{
"name": "pod_cpu_line",
"title": "CPU",
"description": "",
"graphType": "line",
"metricName": "pod",
"queryExpression": "sum(rate(container_cpu_usage_seconds_total{pod=~\"{{"{{"}}.name{{"}}"}}\", image!=\"\", container!=\"POD\", container!=\"\", container_name!=\"POD\"}[5m])) by (pod)"
},
{
"name": "pod_cpu_pie",
"title": "CPU Avg",
"description": "",
"graphType": "pie",
"metricName": "pod",
"queryExpression": "sum(rate(container_cpu_usage_seconds_total{pod=~\"{{"{{"}}.name{{"}}"}}\", container!=\"POD\", image!=\"\", container!=\"\", container_name!=\"POD\"}[5m])) by (pod)"
},
{
"name": "pod_memory_line",
"title": "Memory",
"description": "",
"graphType": "line",
"metricName": "pod",
"queryExpression": "sum(rate(container_memory_usage_bytes{pod=~\"{{"{{"}}.name{{"}}"}}\", container!=\"POD\", image!=\"\", container!=\"\", container_name!=\"POD\"}[5m])) by (pod)"
},
{
"name": "pod_memory_pie",
"title": "Mem Avg",
"description": "",
"graphType": "pie",
"metricName": "pod",
"queryExpression": "sum(rate(container_memory_usage_bytes{pod=~\"{{"{{"}}.name{{"}}"}}\", container!=\"POD\", image!=\"\", container!=\"\", container_name!=\"POD\"}[5m])) by (pod)"
}
]
}
]
},
{
"groupKind": "rollout",
"tabs": ["Golden Signal"],
"rows": [
{
"name": "httplatency",
"title": "HTTP Latency",
"tab": "Golden Signal",
"graphs": [
{
"name": "http_200_latency",
"title": "Latency",
"description": "",
"graphType": "line",
"metricName": "rollout_template_hash",
"queryExpression": "sum(rate(http_server_requests_seconds_sum {namespace=\"{{"{{"}}.namespace{{"}}"}}\", status=\"200\"} [1m])) by (rollout_template_hash)"
}
]
},
{
"name": "httperrortate",
"title": "HTTP Error Rate",
"tab": "Golden Signal",
"graphs": [
{
"name": "http_error_rate_500",
"title": "HTTP Error 500",
"description": "",
"graphType": "line",
"metricName": "rollout_template_hash",
"queryExpression": "sum(rate(http_server_requests_seconds_count {namespace=\"{{"{{"}}.namespace{{"}}"}}\", status=\"500\"} [1m])) by (rollout_template_hash)"
},
{
"name": "http_error_rate_400",
"title": "HTTP Error 400",
"description": "",
"graphType": "line",
"metricName": "rollout_template_hash",
"queryExpression": "sum(rate(http_server_requests_seconds_count {namespace=\"{{"{{"}}.namespace{{"}}"}}\", status=\"404\"} [1m])) by (rollout_template_hash)"
}
]
},
{
"name": "httptraffic",
"title": "HTTP Traffic",
"tab": "Golden Signal",
"graphs": [
{
"name": "http_traffic",
"title": "Traffic",
"description": "",
"graphType": "line",
"metricName": "rollout_template_hash",
"queryExpression": "sum(rate(http_server_requests_seconds_count {namespace=\"{{"{{"}}.namespace{{"}}"}}\"} [1m])) by (rollout_template_hash)"
}
]
},
{
"name": "pod",
"title": "Pods",
"tab": "Golden Signal",
"graphs": [
{
"name": "pod_cpu_line",
"title": "CPU",
"description": "",
"graphType": "line",
"metricName": "pod",
"queryExpression": "sum(rate(container_cpu_usage_seconds_total{pod=~\"{{"{{"}}.name{{"}}"}}\", image!=\"\", container!=\"POD\", container!=\"\", container_name!=\"POD\"}[5m])) by (pod)"
},
{
"name": "pod_cpu_pie",
"title": "CPU Avg",
"description": "",
"graphType": "pie",
"metricName": "pod",
"queryExpression": "sum(rate(container_cpu_usage_seconds_total{pod=~\"{{"{{"}}.name{{"}}"}}\", container!=\"POD\", image!=\"\", container!=\"\", container_name!=\"POD\"}[5m])) by (pod)"
},
{
"name": "pod_memory_line",
"title": "Memory",
"description": "",
"graphType": "line",
"metricName": "pod",
"queryExpression": "sum(rate(container_memory_usage_bytes{pod=~\"{{"{{"}}.name{{"}}"}}\", container!=\"POD\", image!=\"\", container!=\"\", container_name!=\"POD\"}[5m])) by (pod)"
},
{
"name": "pod_memory_pie",
"title": "Mem Avg",
"description": "",
"graphType": "pie",
"metricName": "pod",
"queryExpression": "sum(rate(container_memory_usage_bytes{pod=~\"{{"{{"}}.name{{"}}"}}\", container!=\"POD\", image!=\"\", container!=\"\", container_name!=\"POD\"}[5m])) by (pod)"
}
]
}
]
}
]
"address": "http://{{ .Values.prometheus.service }}.{{ .Values.prometheus.namespace }}.svc.cluster.local:{{ .Values.prometheus.port }}"
}
],
"provider":
{
"Name": "default",
"default": true,
"address": "http://{{ .Values.prometheus.service }}.{{ .Values.prometheus.namespace }}.svc.cluster.local:{{ .Values.prometheus.port }}"
}
}
}
3 changes: 3 additions & 0 deletions charts/argocd-metrics-server/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
"prometheus": {
"type": "object",
"properties": {
"dashboards": {
"type": "string"
},
"namespace": {
"type": "string"
},
Expand Down
Loading

0 comments on commit 0ae4cd3

Please sign in to comment.