Skip to content

Commit

Permalink
Add dashboard label for sidecar (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcattin authored Nov 2, 2023
1 parent 5cc17d5 commit 96ea1eb
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 21 deletions.
62 changes: 42 additions & 20 deletions chart/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 2,
"id": 15,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"description": "",
"gridPos": {
"h": 24,
"w": 17,
Expand All @@ -55,7 +56,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"exemplar": false,
Expand All @@ -69,7 +70,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"exemplar": false,
Expand All @@ -88,7 +89,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -141,7 +142,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum by (server_port) (increase((caretta_links_observed{client_namespace=~\"$namespace\", client_kind=~\"$kind\", client_name=~\"$workload\", server_port=~\"$port\"} or caretta_links_observed{server_namespace=~\"$namespace\", server_kind=~\"$kind\", server_name=~\"$workload\", server_port=~\"$port\"})[$__range:$__interval])) > 0",
Expand Down Expand Up @@ -174,13 +175,13 @@
"content": "<table style=\"width:100%; height:100%;border:0px solid black;\">\n <td style=\"text-align: center;vertical-align: middle;border:0px solid black; \">\n<div style=\"text-align: center\">\n<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/groundcover-com/caretta/main/images/logo.svg\" width=\"75%\" alt=\"caretta\" title=\"caretta\" />\n <h4>by <a href=\"https://www.groundcover.com\">groundcover</h4>\n\n \n [![slack](https://img.shields.io/badge/slack-groundcover-yellowgreen.svg?logo=slack)](http://www.groundcover.com/join-slack)\n \n</div>\n</p>\n</div>\n</td>\n</table>\n",
"mode": "markdown"
},
"pluginVersion": "9.3.1",
"pluginVersion": "10.1.2",
"type": "text"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -225,14 +226,15 @@
"fields": "",
"values": false
},
"showUnfilled": true
"showUnfilled": true,
"valueMode": "color"
},
"pluginVersion": "9.3.1",
"pluginVersion": "10.1.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"exemplar": false,
Expand All @@ -250,7 +252,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -298,12 +300,12 @@
"text": {},
"textMode": "auto"
},
"pluginVersion": "9.3.1",
"pluginVersion": "10.1.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"exemplar": false,
Expand All @@ -319,11 +321,31 @@
"type": "stat"
}
],
"schemaVersion": 37,
"refresh": "",
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "default",
"value": "default"
},
"hide": 0,
"includeAll": false,
"label": "datasource",
"multi": false,
"name": "DS_PROMETHEUS",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"allValue": "(.*)",
"current": {
Expand All @@ -337,7 +359,7 @@
},
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"definition": "query_result(caretta_links_observed)",
"hide": 0,
Expand Down Expand Up @@ -368,7 +390,7 @@
},
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"definition": "query_result(caretta_links_observed)",
"hide": 0,
Expand Down Expand Up @@ -399,7 +421,7 @@
},
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"definition": "query_result(caretta_links_observed)",
"hide": 0,
Expand Down Expand Up @@ -431,7 +453,7 @@
},
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"definition": "label_values(server_port)",
"hide": 0,
Expand Down Expand Up @@ -460,6 +482,6 @@
"timezone": "",
"title": "Caretta Dashboard",
"uid": "k0Om62pVf",
"version": 1,
"version": 2,
"weekStart": ""
}
4 changes: 4 additions & 0 deletions chart/templates/grafana/dashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: ConfigMap
metadata:
name: caretta-grafana-dashboards
namespace: {{ .Release.Namespace }}
labels:
{{- if $.Values.grafana.sidecar.dashboards.enabled }}
{{ $.Values.grafana.sidecar.dashboards.label }}: {{ $.Values.grafana.sidecar.dashboards.labelValue | quote }}
{{- end }}
data:
dashboard.json: |-
{{ .Files.Get "dashboard.json" | indent 4}}
7 changes: 6 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ grafana:
access: proxy
url: "http://caretta-vm:8428"
editable: "true"


sidecar:
dashboards:
label: grafana_dashboard
labelValue: ""

dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
Expand Down

0 comments on commit 96ea1eb

Please sign in to comment.