Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add grafana deployment #181

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- name: Testing add greptime helm repo
run: |
helm repo add greptime https://greptimeteam.github.io/helm-charts/
helm repo add grafana https://grafana.github.io/helm-charts/
helm search repo greptime

- uses: actions/setup-python@v4
Expand Down
6 changes: 6 additions & 0 deletions charts/greptimedb-cluster/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: grafana
repository: https://grafana.github.io/helm-charts
version: 8.5.8
digest: sha256:b179fe8efb2cf11a027a8c49ee1cba728dab1be054f625c92fc9fdfffd0f1ab5
generated: "2024-10-26T14:46:51.314884+08:00"
8 changes: 7 additions & 1 deletion charts/greptimedb-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: greptimedb-cluster
description: A Helm chart for deploying GreptimeDB cluster in Kubernetes.
type: application
version: 0.2.23
version: 0.2.24
appVersion: 0.9.5
home: https://github.com/GreptimeTeam/greptimedb
sources:
Expand All @@ -17,3 +17,9 @@ maintainers:
- name: zyy17
email: [email protected]
url: https://github.com/zyy17

dependencies:
- name: grafana
version: "8.5.8"
repository: https://grafana.github.io/helm-charts
condition: grafana.enabled
29 changes: 28 additions & 1 deletion charts/greptimedb-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A Helm chart for deploying GreptimeDB cluster in Kubernetes.

![Version: 0.2.23](https://img.shields.io/badge/Version-0.2.23-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.5](https://img.shields.io/badge/AppVersion-0.9.5-informational?style=flat-square)
![Version: 0.2.24](https://img.shields.io/badge/Version-0.2.24-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.5](https://img.shields.io/badge/AppVersion-0.9.5-informational?style=flat-square)

## Source Code

Expand Down Expand Up @@ -69,6 +69,12 @@ If you set `storage.s3.root` as `mycluser`, then the data layout will be:
helm uninstall mycluster -n default
```

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://grafana.github.io/helm-charts | grafana | 8.5.8 |

## Values

| Key | Type | Default | Description |
Expand Down Expand Up @@ -177,6 +183,27 @@ helm uninstall mycluster -n default
| frontend.replicas | int | `1` | Frontend replicas |
| frontend.service | object | `{}` | Frontend service |
| frontend.tls | object | `{}` | Frontend tls configure |
| grafana | object | `{"adminPassword":"gt-operator","adminUser":"admin","dashboardProviders":{"dashboardproviders.yaml":{"apiVersion":1,"providers":[{"disableDeletion":false,"editable":true,"name":"greptimedb-cluster-metrics","options":{"path":"/var/lib/grafana/dashboards/greptimedb-cluster-metrics"},"orgId":1,"type":"file"},{"disableDeletion":false,"editable":true,"name":"greptimedb-cluster-logs","options":{"path":"/var/lib/grafana/dashboards/greptimedb-cluster-logs"},"orgId":1,"type":"file"},{"disableDeletion":false,"editable":true,"name":"greptimedb-cluster-slow-queries","options":{"path":"/var/lib/grafana/dashboards/greptimedb-cluster-slow-queries"},"orgId":1,"type":"file"}]}},"dashboardsConfigMaps":{"greptimedb-cluster-logs":"greptimedb-cluster-logs-dashboard","greptimedb-cluster-metrics":"greptimedb-cluster-metrics-dashboard","greptimedb-cluster-slow-queries":"greptimedb-cluster-slow-queries-dashboard"},"datasources":{"datasources.yaml":{"datasources":[{"access":"proxy","isDefault":true,"name":"greptimedb-metrics","type":"prometheus","url":"http://mycluster-monitor-standalone.default.svc.cluster.local:4000/v1/prometheus"},{"access":"proxy","database":"public","name":"greptimedb-logs","type":"mysql","url":"mycluster-monitor-standalone.default.svc.cluster.local:4002"}]}},"enabled":false,"image":{"registry":"docker.io","repository":"grafana/grafana","tag":"11.1.3"},"initChownData":{"enabled":false},"persistence":{"accessModes":["ReadWriteOnce"],"enabled":true,"size":"10Gi"},"service":{"annotations":{},"enabled":true,"type":"ClusterIP"}}` | Deploy grafana for monitoring. |
| grafana.adminPassword | string | `"gt-operator"` | The default admin password for grafana. |
| grafana.adminUser | string | `"admin"` | The default admin username for grafana. |
| grafana.dashboardProviders | object | `{"dashboardproviders.yaml":{"apiVersion":1,"providers":[{"disableDeletion":false,"editable":true,"name":"greptimedb-cluster-metrics","options":{"path":"/var/lib/grafana/dashboards/greptimedb-cluster-metrics"},"orgId":1,"type":"file"},{"disableDeletion":false,"editable":true,"name":"greptimedb-cluster-logs","options":{"path":"/var/lib/grafana/dashboards/greptimedb-cluster-logs"},"orgId":1,"type":"file"},{"disableDeletion":false,"editable":true,"name":"greptimedb-cluster-slow-queries","options":{"path":"/var/lib/grafana/dashboards/greptimedb-cluster-slow-queries"},"orgId":1,"type":"file"}]}}` | The grafana dashboard providers. |
| grafana.dashboardsConfigMaps | object | `{"greptimedb-cluster-logs":"greptimedb-cluster-logs-dashboard","greptimedb-cluster-metrics":"greptimedb-cluster-metrics-dashboard","greptimedb-cluster-slow-queries":"greptimedb-cluster-slow-queries-dashboard"}` | The grafana dashboards configmaps that will be created to store the dashboards. |
| grafana.datasources | object | `{"datasources.yaml":{"datasources":[{"access":"proxy","isDefault":true,"name":"greptimedb-metrics","type":"prometheus","url":"http://mycluster-monitor-standalone.default.svc.cluster.local:4000/v1/prometheus"},{"access":"proxy","database":"public","name":"greptimedb-logs","type":"mysql","url":"mycluster-monitor-standalone.default.svc.cluster.local:4002"}]}}` | The grafana datasources. |
| grafana.enabled | bool | `false` | Enable grafana deployment. It needs to enable monitoring `monitoring.enabled: true` first. |
| grafana.image | object | `{"registry":"docker.io","repository":"grafana/grafana","tag":"11.1.3"}` | The grafana image. |
| grafana.image.registry | string | `"docker.io"` | The grafana image registry. |
| grafana.image.repository | string | `"grafana/grafana"` | The grafana image repository. |
| grafana.image.tag | string | `"11.1.3"` | The grafana image tag. |
| grafana.initChownData | object | `{"enabled":false}` | Init chown data for grafana. |
| grafana.initChownData.enabled | bool | `false` | Enable init chown data for grafana. |
| grafana.persistence | object | `{"accessModes":["ReadWriteOnce"],"enabled":true,"size":"10Gi"}` | The grafana persistence configuration. |
| grafana.persistence.accessModes | list | `["ReadWriteOnce"]` | The access modes for the grafana persistence. |
| grafana.persistence.enabled | bool | `true` | Whether to enable the persistence for grafana. |
| grafana.persistence.size | string | `"10Gi"` | The storage size for the grafana persistence. |
| grafana.service | object | `{"annotations":{},"enabled":true,"type":"ClusterIP"}` | The grafana service configuration. |
| grafana.service.annotations | object | `{}` | The annotations for the grafana service. |
| grafana.service.enabled | bool | `true` | Whether to create the service for grafana. |
| grafana.service.type | string | `"ClusterIP"` | The type of the service. |
| grpcServicePort | int | `4001` | GreptimeDB grpc service port |
| httpServicePort | int | `4000` | GreptimeDB http service port |
| image.pullSecrets | list | `[]` | The image pull secrets |
Expand Down
293 changes: 293 additions & 0 deletions charts/greptimedb-cluster/dashboards/greptimedb-cluster-logs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,293 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 2,
"links": [],
"panels": [
{
"datasource": {
"default": false,
"type": "mysql",
"uid": "${datasource}"
},
"gridPos": {
"h": 20,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"dedupStrategy": "none",
"enableLogDetails": true,
"prettifyLogMessage": false,
"showCommonLabels": false,
"showLabels": false,
"showTime": true,
"sortOrder": "Descending",
"wrapLogMessage": false
},
"targets": [
{
"dataset": "greptime_private",
"datasource": {
"type": "mysql",
"uid": "${datasource}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT `timestamp`, CONCAT('[', `level`, ']', ' ', `target`, ' ', `message`),\n `role`,\n `pod`,\n `pod_ip`,\n `namespace`,\n `cluster`,\n `err`,\n `file`,\n `module_path`\nFROM\n `_gt_logs`\nWHERE\n (\n \"$level\" = \"'all'\"\n OR `level` IN ($level)\n ) \n AND (\n \"$role\" = \"'all'\"\n OR `role` IN ($role)\n )\n AND (\n \"$pods\" = \"'all'\"\n OR `pod` IN ($pods)\n )\n AND (\n \"$search\" = \"\"\n OR MATCHES(`message`, \"$search\")\n )\n AND $__timeFilter(`timestamp`)\nORDER BY\n `timestamp`\nLIMIT $limit;\n",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Logs",
"type": "logs"
}
],
"schemaVersion": 39,
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "greptimedb-cluster-logs",
"value": "ddxce12e8bl6oe"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "datasource",
"options": [],
"query": "mysql",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"allValue": "'all'",
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"hide": 0,
"includeAll": true,
"label": "level",
"multi": true,
"name": "level",
"options": [
{
"selected": true,
"text": "All",
"value": "$__all"
},
{
"selected": false,
"text": "INFO",
"value": "INFO"
},
{
"selected": false,
"text": "ERROR",
"value": "ERROR"
},
{
"selected": false,
"text": "WARN",
"value": "WARN"
},
{
"selected": false,
"text": "DEBUG",
"value": "DEBUG"
},
{
"selected": false,
"text": "TRACE",
"value": "TRACE"
}
],
"query": "INFO,ERROR,WARN,DEBUG,TRACE",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
},
{
"allValue": "'all'",
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"hide": 0,
"includeAll": true,
"label": "role",
"multi": true,
"name": "role",
"options": [
{
"selected": true,
"text": "All",
"value": "$__all"
},
{
"selected": false,
"text": "datanode",
"value": "datanode"
},
{
"selected": false,
"text": "frontend",
"value": "frontend"
},
{
"selected": false,
"text": "meta",
"value": "meta"
}
],
"query": "datanode,frontend,meta",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
},
{
"allValue": "'all'",
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": {
"type": "mysql",
"uid": "${datasource}"
},
"definition": "SELECT DISTINCT pod FROM _gt_logs WHERE (\"$role\" = \"'all'\" OR `role` IN ($role))",
"hide": 0,
"includeAll": true,
"multi": true,
"name": "pods",
"options": [],
"query": "SELECT DISTINCT pod FROM _gt_logs WHERE (\"$role\" = \"'all'\" OR `role` IN ($role))",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"current": {
"selected": true,
"text": "1000",
"value": "1000"
},
"hide": 0,
"includeAll": false,
"label": "limit",
"multi": false,
"name": "limit",
"options": [
{
"selected": true,
"text": "1000",
"value": "1000"
},
{
"selected": false,
"text": "3000",
"value": "3000"
},
{
"selected": false,
"text": "5000",
"value": "5000"
}
],
"query": "1000,3000,5000",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
},
{
"current": {
"selected": false,
"text": "",
"value": ""
},
"hide": 0,
"label": "search",
"name": "search",
"options": [
{
"selected": true,
"text": "",
"value": ""
}
],
"query": "",
"skipUrlSync": false,
"type": "textbox"
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "GreptimeDB Cluster Logs",
"uid": "edx5veo4rd3wge",
"version": 4,
"weekStart": ""
}
Loading
Loading