Skip to content

Commit

Permalink
almost grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
suparious committed Jun 10, 2024
1 parent cc1f73e commit 84f0415
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 1 deletion.
91 changes: 91 additions & 0 deletions dashboards/performance_dashboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"dashboard": {
"id": null,
"title": "Performance Dashboard",
"tags": [],
"timezone": "browser",
"schemaVersion": 16,
"version": 0,
"panels": [
{
"title": "CPU Usage",
"type": "graph",
"targets": [
{
"expr": "avg(rate(node_cpu_seconds_total{mode='user'}[1m])) by (instance)",
"legendFormat": "{{instance}}",
"refId": "A"
}
],
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 0
},
"id": 1
},
{
"title": "Memory Usage",
"type": "graph",
"targets": [
{
"expr": "node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes",
"legendFormat": "{{instance}}",
"refId": "A"
}
],
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 0
},
"id": 2
},
{
"title": "Disk Usage",
"type": "graph",
"targets": [
{
"expr": "node_filesystem_size_bytes - node_filesystem_free_bytes",
"legendFormat": "{{instance}}",
"refId": "A"
}
],
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 9
},
"id": 3
},
{
"title": "Network I/O",
"type": "graph",
"targets": [
{
"expr": "rate(node_network_receive_bytes_total[1m])",
"legendFormat": "Receive - {{instance}}",
"refId": "A"
},
{
"expr": "rate(node_network_transmit_bytes_total[1m])",
"legendFormat": "Transmit - {{instance}}",
"refId": "B"
}
],
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 9
},
"id": 4
}
],
"refresh": "5s"
},
"overwrite": false
}
18 changes: 17 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
build: .
ports:
- "5000:5000"
- "8000:8000"
environment:
- VALKEY_HOST=valkey
depends_on:
Expand All @@ -15,14 +16,29 @@ services:
valkey:
image: docker.io/valkey/valkey:latest
environment:
- ALLOW_EMPTY_PASSWORD=yes # Recommended only for development
- ALLOW_EMPTY_PASSWORD=yes
- VALKEY_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
ports:
- "6379:6379"
command: valkey-server --appendonly yes
volumes:
- valkey_data:/data

grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana_data:/var/lib/grafana
- ./provisioning:/etc/grafana/provisioning
- ./dashboards:/var/lib/grafana/dashboards
depends_on:
- app

volumes:
valkey_data:
driver: local
grafana_data:
driver: local
11 changes: 11 additions & 0 deletions provisioning/dashboards/dashboards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: 1

providers:
- name: 'default'
orgId: 1
folder: ''
type: file
options:
path: /var/lib/grafana/dashboards
disableDeletion: false
updateIntervalSeconds: 10
8 changes: 8 additions & 0 deletions provisioning/datasources/datasources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: 1

datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://app:8000
isDefault: true

0 comments on commit 84f0415

Please sign in to comment.