-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📦 moves grafana assets as part of
cdviz-grafana
- Loading branch information
Showing
13 changed files
with
252 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
{ | ||
"annotations": { | ||
"list": [ | ||
{ | ||
"builtIn": 1, | ||
"datasource": { | ||
"type": "grafana", | ||
"uid": "-- Grafana --" | ||
}, | ||
"enable": true, | ||
"hide": true, | ||
"iconColor": "rgba(0, 211, 255, 1)", | ||
"name": "Annotations & Alerts", | ||
"type": "dashboard" | ||
} | ||
] | ||
}, | ||
"description": "", | ||
"editable": true, | ||
"fiscalYearStartMonth": 0, | ||
"graphTooltip": 0, | ||
"id": 1, | ||
"links": [], | ||
"liveNow": false, | ||
"panels": [ | ||
{ | ||
"datasource": { | ||
"type": "postgres", | ||
"uid": "P3ABDE63318046581" | ||
}, | ||
"gridPos": { | ||
"h": 8, | ||
"w": 24, | ||
"x": 0, | ||
"y": 0 | ||
}, | ||
"id": 1, | ||
"options": { | ||
"dedupStrategy": "none", | ||
"enableLogDetails": true, | ||
"prettifyLogMessage": false, | ||
"showCommonLabels": true, | ||
"showLabels": false, | ||
"showTime": true, | ||
"sortOrder": "Descending", | ||
"wrapLogMessage": true | ||
}, | ||
"pluginVersion": "10.2.2", | ||
"targets": [ | ||
{ | ||
"datasource": { | ||
"type": "postgres", | ||
"uid": "P3ABDE63318046581" | ||
}, | ||
"editorMode": "code", | ||
"format": "table", | ||
"rawQuery": true, | ||
"rawSql": "SELECT \"timestamp\",\n \"payload\"\nFROM \"cdevents_lake\"\nWHERE $__timeFilter(timestamp) \nORDER BY \"timestamp\" DESC", | ||
"refId": "A", | ||
"sql": { | ||
"columns": [ | ||
{ | ||
"parameters": [], | ||
"type": "function" | ||
} | ||
], | ||
"groupBy": [ | ||
{ | ||
"property": { | ||
"type": "string" | ||
}, | ||
"type": "groupBy" | ||
} | ||
], | ||
"limit": 50 | ||
} | ||
} | ||
], | ||
"title": "Events Logs", | ||
"type": "logs" | ||
} | ||
], | ||
"refresh": "", | ||
"schemaVersion": 38, | ||
"tags": [], | ||
"templating": { | ||
"list": [] | ||
}, | ||
"time": { | ||
"from": "now-6h", | ||
"to": "now" | ||
}, | ||
"timepicker": {}, | ||
"timezone": "", | ||
"title": "cdevents activity", | ||
"uid": "a6eeda5f-2550-438c-9477-8ed28ab50ce6", | ||
"version": 1, | ||
"weekStart": "" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v2 | ||
name: cdviz-grafana | ||
description: cdviz's grafana resources (dashboards, datasources, ...) | ||
type: application | ||
version: 0.1.0 # TODO Change this to a version number on release | ||
appVersion: 0.1.0 # TODO Change this to a version number on release |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
../../cdviz-grafana/dashboards/ |
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "my.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "my.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "my.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "my.labels" -}} | ||
helm.sh/chart: {{ include "my.chart" . }} | ||
{{ include "my.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "my.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "my.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "my.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "my.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
8 changes: 4 additions & 4 deletions
8
...s/cdviz/templates/grafana-dashboards.yaml → ...grafana/templates/grafana-dashboards.yaml
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,18 +1,18 @@ | ||
{{- if .Values.grafanaAssets.enabled -}} | ||
{{- if .Values.dashboards.enabled -}} | ||
{{- $files := .Files.Glob "grafana-dashboards/*.{yaml,json}" }} | ||
{{- if $files }} | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: "{{ include "my.fullname" $ }}-grafana-dashboards" | ||
name: "{{ include "my.fullname" $ }}-dashboards" | ||
labels: | ||
grafana_dashboard: "1" | ||
{{- toYaml .Values.dashboards.annotations | nindent 4}} | ||
{{- include "my.labels" $ | nindent 4 }} | ||
data: | ||
{{- range $path, $fileContents := $files }} | ||
{{ include "my.fullname" $ }}-{{ base $path }}: |- | ||
{{ $.Files.Get $path | nindent 4 }} | ||
{{ tpl ($.Files.Get $path) $ | nindent 4 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end -}} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- if (and .Values.datasources.enabled .Values.datasources.definitions) -}} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: "{{ include "my.fullname" $ }}-datasources" | ||
labels: | ||
{{- toYaml .Values.datasources.annotations | nindent 4}} | ||
{{- include "my.labels" . | nindent 4 }} | ||
data: | ||
{{ include "my.fullname" $ }}-datasources.yaml: |- | ||
apiVersion: 1 | ||
datasources: | ||
{{- range $name, $def := .Values.datasources.definitions }} | ||
- name: {{ $name }} | ||
{{- tpl (toYaml $def ) $ | nindent 8 }} | ||
{{- end }} | ||
{{- end -}} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
datasources: | ||
enabled: true | ||
annotations: | ||
grafana_datasource: "1" | ||
definitions: | ||
cdviz: | ||
# same syntax than on grafana datasources provisionner | ||
type: postgres | ||
url: '$POSTGRES_HOST' | ||
user: '$POSTGRES_USER_CDVIZ_READER' # from env var (injected via secrets) | ||
secureJsonData: | ||
password: '$POSTGRES_PASSWORD_CDVIZ_READER' | ||
jsonData: | ||
database: '$POSTGRES_DB' | ||
sslmode: 'disable' # disable/require/verify-ca/verify-full | ||
maxOpenConns: 10 # Grafana v5.4+ | ||
maxIdleConns: 10 # Grafana v5.4+ | ||
maxIdleConnsAuto: true # Grafana v9.5.1+ | ||
connMaxLifetime: 14400 # Grafana v5.4+ | ||
postgresVersion: 1000 | ||
timescaledb: false | ||
|
||
dashboards: | ||
enabled: true | ||
annotations: | ||
grafana_dashboard: "1" |
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 was deleted.
Oops, something went wrong.
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