docker: prometheus and grafana for development (#16649)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
12797586f9
Коммит
d5659adbd7
15
build/docker/grafana/dashboards/README.md
Обычный файл
15
build/docker/grafana/dashboards/README.md
Обычный файл
@@ -0,0 +1,15 @@
|
||||
# Developer Dashboards
|
||||
|
||||
This folder contains a modified form of the following Grafana dashboards:
|
||||
* [Mattermost Performance Monitoring](https://grafana.com/grafana/dashboards/2542)
|
||||
* [Mattermost Performance Monitoring (Bonus Metrics)](https://grafana.com/grafana/dashboards/2545)
|
||||
* [Mattermost Performance KPI Metrics](https://grafana.com/grafana/dashboards/2539)
|
||||
|
||||
The dashboards are modified from the version available on grafana.com since [Grafana doesn't currently support variables](https://github.com/grafana/grafana/issues/10786) (i.e. `${DS_MATTERMOST}`) and has no way of binding the datasource with the dashboards at the time of provisioning. Instead of falling back to the REST API to effect these changes, the following in-place changes were made to the exported dashboards available above:
|
||||
* Remove the top-level `__inputs` key
|
||||
* Remove the top-level `__requires` key
|
||||
* Replace all instances of `${DS_MATTERMOST}` with `Prometheus`, matching the name of the provisioned datasource.
|
||||
|
||||
Upon using the dashboards within Grafana however, it immediately adds various missing fields, presumably due to some internal migration. This results in a spurious prompt to "save" the dashboard. To avoid confusion, these changes were subsequently exported and written back into the provisioned dashboards above.
|
||||
|
||||
This entire process above will need to be repeated in the event newer versions of these dashboards are published.
|
||||
129
build/docker/grafana/dashboards/home.json
Обычный файл
129
build/docker/grafana/dashboards/home.json
Обычный файл
@@ -0,0 +1,129 @@
|
||||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": "-- Grafana --",
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"gnetId": null,
|
||||
"graphTooltip": 0,
|
||||
"id": 5,
|
||||
"links": [],
|
||||
"panels": [
|
||||
{
|
||||
"datasource": null,
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"custom": {}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 3,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"id": 1,
|
||||
"title": "",
|
||||
"type": "welcome"
|
||||
},
|
||||
{
|
||||
"datasource": null,
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"custom": {}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 15,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 3
|
||||
},
|
||||
"headings": true,
|
||||
"id": 3,
|
||||
"limit": 30,
|
||||
"links": [],
|
||||
"query": "Mattermost",
|
||||
"recent": false,
|
||||
"search": true,
|
||||
"starred": false,
|
||||
"tags": [],
|
||||
"title": "Dashboards",
|
||||
"type": "dashlist"
|
||||
},
|
||||
{
|
||||
"datasource": null,
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"custom": {}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 15,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 3
|
||||
},
|
||||
"id": 4,
|
||||
"links": [],
|
||||
"options": {
|
||||
"feedUrl": "https://grafana.com/blog/news.xml"
|
||||
},
|
||||
"title": "Latest from the blog",
|
||||
"type": "news"
|
||||
}
|
||||
],
|
||||
"schemaVersion": 26,
|
||||
"style": "dark",
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {
|
||||
"hidden": true,
|
||||
"refresh_intervals": [
|
||||
"5s",
|
||||
"10s",
|
||||
"30s",
|
||||
"1m",
|
||||
"5m",
|
||||
"15m",
|
||||
"30m",
|
||||
"1h",
|
||||
"2h",
|
||||
"1d"
|
||||
],
|
||||
"time_options": [
|
||||
"5m",
|
||||
"15m",
|
||||
"1h",
|
||||
"6h",
|
||||
"12h",
|
||||
"24h",
|
||||
"2d",
|
||||
"7d",
|
||||
"30d"
|
||||
],
|
||||
"type": "timepicker"
|
||||
},
|
||||
"timezone": "browser",
|
||||
"title": "Home",
|
||||
"uid": "4yRNKfaGz",
|
||||
"version": 1
|
||||
}
|
||||
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
9
build/docker/grafana/grafana.ini
Обычный файл
9
build/docker/grafana/grafana.ini
Обычный файл
@@ -0,0 +1,9 @@
|
||||
[auth]
|
||||
disable_login_form = false
|
||||
|
||||
[auth.anonymous]
|
||||
enabled = true
|
||||
org_role = Editor
|
||||
|
||||
[dashboards]
|
||||
default_home_dashboard_path = /var/lib/grafana/dashboards/home.json
|
||||
14
build/docker/grafana/provisioning/dashboards/mattermost.yaml
Обычный файл
14
build/docker/grafana/provisioning/dashboards/mattermost.yaml
Обычный файл
@@ -0,0 +1,14 @@
|
||||
apiVersion: 1
|
||||
|
||||
providers:
|
||||
- name: 'mattermost'
|
||||
orgId: 1
|
||||
folder: 'mattermost'
|
||||
type: file
|
||||
disableDeletion: true
|
||||
updateIntervalSeconds: 300
|
||||
allowUiUpdates: true
|
||||
options:
|
||||
# <string, required> path to dashboard files on disk. Required when using the 'file' type
|
||||
path: /var/lib/grafana/dashboards
|
||||
foldersFromFilesStructure: true
|
||||
11
build/docker/grafana/provisioning/datasources/prometheus.yml
Обычный файл
11
build/docker/grafana/provisioning/datasources/prometheus.yml
Обычный файл
@@ -0,0 +1,11 @@
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Prometheus
|
||||
type: 'prometheus'
|
||||
access: 'proxy'
|
||||
orgId: 1
|
||||
url: 'http://prometheus:9090'
|
||||
isDefault: true
|
||||
version: 1
|
||||
editable: false
|
||||
8
build/docker/prometheus-linux.yml
Обычный файл
8
build/docker/prometheus-linux.yml
Обычный файл
@@ -0,0 +1,8 @@
|
||||
global:
|
||||
scrape_interval: 5s
|
||||
evaluation_interval: 60s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'mattermost'
|
||||
static_configs:
|
||||
- targets: ['172.17.0.1:8067']
|
||||
8
build/docker/prometheus.yml
Обычный файл
8
build/docker/prometheus.yml
Обычный файл
@@ -0,0 +1,8 @@
|
||||
global:
|
||||
scrape_interval: 5s
|
||||
evaluation_interval: 60s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'mattermost'
|
||||
static_configs:
|
||||
- targets: ['host.docker.internal:8067']
|
||||
Ссылка в новой задаче
Block a user