added grafana and minor fix
This commit is contained in:
parent
81ec59d220
commit
fdf9f04bc6
6 changed files with 296 additions and 103 deletions
85
grafana/dashboards/dereth_tracker_dashboard.json
Normal file
85
grafana/dashboards/dereth_tracker_dashboard.json
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
{
|
||||
"id": null,
|
||||
"uid": "dereth-tracker",
|
||||
"title": "Dereth Tracker Dashboard",
|
||||
"schemaVersion": 30,
|
||||
"version": 1,
|
||||
"refresh": "10s",
|
||||
"panels": [
|
||||
{
|
||||
"type": "timeseries",
|
||||
"title": "Kills per Hour",
|
||||
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 0 },
|
||||
"id": 1,
|
||||
"fieldConfig": { "defaults": {}, "overrides": [] },
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"format": "time_series",
|
||||
"datasource": { "uid": "dereth-db" },
|
||||
"rawSql": "SELECT $__time(timestamp), kills_per_hour AS value FROM telemetry_events WHERE character_name = '$character' ORDER BY timestamp"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "timeseries",
|
||||
"title": "Memory (MB)",
|
||||
"gridPos": { "h": 8, "w": 6, "x": 0, "y": 8 },
|
||||
"id": 2,
|
||||
"fieldConfig": { "defaults": {}, "overrides": [] },
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"format": "time_series",
|
||||
"datasource": { "uid": "dereth-db" },
|
||||
"rawSql": "SELECT $__time(timestamp), mem_mb AS value FROM telemetry_events WHERE character_name = '$character' ORDER BY timestamp"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "timeseries",
|
||||
"title": "CPU (%)",
|
||||
"gridPos": { "h": 8, "w": 6, "x": 6, "y": 8 },
|
||||
"id": 3,
|
||||
"fieldConfig": { "defaults": {}, "overrides": [] },
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"format": "time_series",
|
||||
"datasource": { "uid": "dereth-db" },
|
||||
"rawSql": "SELECT $__time(timestamp), cpu_pct AS value FROM telemetry_events WHERE character_name = '$character' ORDER BY timestamp"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "timeseries",
|
||||
"title": "Mem Handles",
|
||||
"gridPos": { "h": 8, "w": 6, "x": 0, "y": 16 },
|
||||
"id": 4,
|
||||
"fieldConfig": { "defaults": {}, "overrides": [] },
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"format": "time_series",
|
||||
"datasource": { "uid": "dereth-db" },
|
||||
"rawSql": "SELECT $__time(timestamp), mem_handles AS value FROM telemetry_events WHERE character_name = '$character' ORDER BY timestamp"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"templating": {
|
||||
"list": [
|
||||
{
|
||||
"type": "query",
|
||||
"name": "character",
|
||||
"label": "Character",
|
||||
"datasource": { "uid": "dereth-db" },
|
||||
"query": "SELECT DISTINCT character_name FROM telemetry_events ORDER BY character_name",
|
||||
"refresh": 2,
|
||||
"sort": 1,
|
||||
"multi": false,
|
||||
"includeAll": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
11
grafana/provisioning/dashboards/dashboards.yaml
Normal file
11
grafana/provisioning/dashboards/dashboards.yaml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
apiVersion: 1
|
||||
|
||||
providers:
|
||||
- name: 'dereth_dashboards'
|
||||
orgId: 1
|
||||
folder: ''
|
||||
type: file
|
||||
disableDeletion: false
|
||||
updateIntervalSeconds: 30
|
||||
options:
|
||||
path: /var/lib/grafana/dashboards
|
||||
16
grafana/provisioning/datasources/datasource.yaml
Normal file
16
grafana/provisioning/datasources/datasource.yaml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: DerethDB
|
||||
uid: dereth-db
|
||||
type: postgres
|
||||
access: proxy
|
||||
url: db:5432
|
||||
database: dereth
|
||||
user: postgres
|
||||
# Securely provision the password
|
||||
secureJsonData:
|
||||
password: ${POSTGRES_PASSWORD}
|
||||
jsonData:
|
||||
sslmode: disable
|
||||
postgresVersion: 1400
|
||||
Loading…
Add table
Add a link
Reference in a new issue