Skip to content

Commit

Permalink
chore: simplify dashboard installation (#1815)
Browse files Browse the repository at this point in the history
Co-authored-by: Moritz Wiesinger <[email protected]>
Co-authored-by: Giovanni Liva <[email protected]>
  • Loading branch information
3 people authored Aug 22, 2023
1 parent 1ddd089 commit 7c4e7bc
Show file tree
Hide file tree
Showing 17 changed files with 378 additions and 2,701 deletions.
8 changes: 4 additions & 4 deletions dashboards/grafana/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ GRAFANA_USERNAME ?= admin
GRAFANA_PASSWORD ?= admin
GRAFANA_PORT ?= 3000

.PHONY: generate
generate: generate-configmaps generate-import
.PHONY: import-json
generate: generate-import import

.PHONY: generate-import
generate-import:
mkdir import | true
./utils/generate-import.sh ./import

.PHONY: generate-configmap
.PHONY: apply-configmaps
generate-configmaps:
mkdir configmap | true
kubectl create configmap grafana-dashboard-keptn-overview -n monitoring --from-file=./grafana_dashboard_overview.json -o yaml --dry-run=client > configmap/grafana-dashboard-keptn-overview.yaml
kubectl create configmap grafana-dashboard-keptn-applications -n monitoring --from-file=./grafana_dashboard_applications.json -o yaml --dry-run=client > configmap/grafana-dashboard-keptn-applications.yaml
kubectl create configmap grafana-dashboard-keptn-workloads -n monitoring --from-file=./grafana_dashboard_workloads.json -o yaml --dry-run=client > configmap/grafana-dashboard-keptn-workloads.yaml
cp configmap/* ../../examples/support/observability/config/prometheus
kubectl apply -f /configmap

.PHONY: import
import:
Expand Down
10 changes: 8 additions & 2 deletions dashboards/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ them in this folder.

## Exporting the dashboards for the Examples

You can prepare the dashboards for the examples and import using the following command:
You can import the default dashboards by running:

```shell
make generate
make apply-configmaps
```

If you prefere to prepare the dashboards for the examples and importing them as json you can use:

```shell
make import-json
```

<!-- markdownlint-disable-next-line MD033 MD013 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ data:
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -83,8 +82,8 @@ data:
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"editorMode": "builder",
"expr": "keptn_app_count_total{keptn_deployment_app_status=\"Succeeded\", keptn_deployment_app_name=\"$Application\"}",
Expand Down Expand Up @@ -118,8 +117,7 @@ data:
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -167,8 +165,7 @@ data:
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"editorMode": "builder",
"expr": "max(keptn_app_active{keptn_deployment_app_name=\"$Application\"})",
Expand All @@ -182,8 +179,7 @@ data:
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -232,8 +228,7 @@ data:
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"editorMode": "builder",
"expr": "keptn_app_count_total{keptn_deployment_app_status=\"Failed\", keptn_deployment_app_name=\"$Application\"}",
Expand Down Expand Up @@ -269,8 +264,7 @@ data:
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -320,8 +314,8 @@ data:
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"editorMode": "builder",
"expr": "avg by(keptn_deployment_app_previousversion, keptn_deployment_app_version) (keptn_app_deploymentinterval{keptn_deployment_app_name=\"$Application\"})",
Expand All @@ -336,8 +330,7 @@ data:
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -390,8 +383,7 @@ data:
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"editorMode": "builder",
"expr": "avg by(keptn_deployment_workload_previousversion) (keptn_app_deploymentinterval{keptn_deployment_app_name=\"$Application\"})",
Expand All @@ -406,8 +398,7 @@ data:
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -456,8 +447,7 @@ data:
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"editorMode": "builder",
"expr": "max by(keptn_deployment_app_version) (keptn_app_deploymentduration{keptn_deployment_app_name=\"$Application\"})",
Expand All @@ -472,8 +462,7 @@ data:
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -549,8 +538,7 @@ data:
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"editorMode": "builder",
"expr": "max(keptn_app_active{keptn_deployment_app_name=\"$Application\"})",
Expand All @@ -567,7 +555,6 @@ data:
{
"datasource": {
"type": "jaeger",
"uid": "PC9A941E8F2E49454"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -618,7 +605,6 @@ data:
{
"datasource": {
"type": "jaeger",
"uid": "PC9A941E8F2E49454"
},
"operation": "AppPreDeployTasks",
"queryType": "search",
Expand All @@ -632,8 +618,7 @@ data:
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -696,8 +681,7 @@ data:
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"editorMode": "builder",
"expr": "keptn_deployment_deploymentduration{keptn_deployment_app_name=\"$Application\"}",
Expand Down Expand Up @@ -756,8 +740,7 @@ data:
"value": "podtato-head"
},
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"definition": "label_values(keptn_deployment_app_name)",
"hide": 0,
Expand All @@ -777,8 +760,7 @@ data:
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "prometheus"
},
"filters": [],
"hide": 0,
Expand All @@ -804,3 +786,5 @@ metadata:
creationTimestamp: null
name: grafana-dashboard-keptn-applications
namespace: monitoring
labels:
grafana_dashboard: '1'
Loading

0 comments on commit 7c4e7bc

Please sign in to comment.