-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add grafana dashboard for monitoring queues
Fixes a bug in the worker where a single worker would take all available work!!! Adds a docker-compose.yml for using Grafana + a dashboard that streams the queue length from Redis. Signed-off-by: Dave Tucker <[email protected]>
- Loading branch information
1 parent
0cad5d9
commit 1ccc436
Showing
5 changed files
with
285 additions
and
5 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,231 @@ | ||
{ | ||
"annotations": { | ||
"list": [ | ||
{ | ||
"builtIn": 1, | ||
"datasource": { | ||
"type": "grafana", | ||
"uid": "-- Grafana --" | ||
}, | ||
"enable": true, | ||
"hide": true, | ||
"iconColor": "rgba(0, 211, 255, 1)", | ||
"name": "Annotations & Alerts", | ||
"target": { | ||
"limit": 100, | ||
"matchAny": false, | ||
"tags": [], | ||
"type": "dashboard" | ||
}, | ||
"type": "dashboard" | ||
} | ||
] | ||
}, | ||
"description": "", | ||
"editable": true, | ||
"fiscalYearStartMonth": 0, | ||
"graphTooltip": 0, | ||
"id": 1, | ||
"links": [], | ||
"liveNow": false, | ||
"panels": [ | ||
{ | ||
"datasource": { | ||
"type": "redis-datasource", | ||
"uid": "PA7F6415749A3297A" | ||
}, | ||
"description": "", | ||
"fieldConfig": { | ||
"defaults": { | ||
"color": { | ||
"mode": "palette-classic" | ||
}, | ||
"custom": { | ||
"axisLabel": "", | ||
"axisPlacement": "auto", | ||
"barAlignment": 0, | ||
"drawStyle": "line", | ||
"fillOpacity": 0, | ||
"gradientMode": "none", | ||
"hideFrom": { | ||
"legend": false, | ||
"tooltip": false, | ||
"viz": false | ||
}, | ||
"lineInterpolation": "linear", | ||
"lineWidth": 1, | ||
"pointSize": 5, | ||
"scaleDistribution": { | ||
"type": "linear" | ||
}, | ||
"showPoints": "auto", | ||
"spanNulls": false, | ||
"stacking": { | ||
"group": "A", | ||
"mode": "none" | ||
}, | ||
"thresholdsStyle": { | ||
"mode": "off" | ||
} | ||
}, | ||
"mappings": [], | ||
"thresholds": { | ||
"mode": "absolute", | ||
"steps": [ | ||
{ | ||
"color": "green", | ||
"value": null | ||
}, | ||
{ | ||
"color": "red", | ||
"value": 80 | ||
} | ||
] | ||
} | ||
}, | ||
"overrides": [] | ||
}, | ||
"gridPos": { | ||
"h": 9, | ||
"w": 12, | ||
"x": 0, | ||
"y": 0 | ||
}, | ||
"id": 2, | ||
"options": { | ||
"legend": { | ||
"calcs": [], | ||
"displayMode": "list", | ||
"placement": "bottom" | ||
}, | ||
"tooltip": { | ||
"mode": "single", | ||
"sort": "none" | ||
} | ||
}, | ||
"targets": [ | ||
{ | ||
"command": "llen", | ||
"datasource": { | ||
"type": "redis-datasource", | ||
"uid": "PA7F6415749A3297A" | ||
}, | ||
"keyName": "generate", | ||
"query": "", | ||
"refId": "A", | ||
"streaming": true, | ||
"type": "command" | ||
} | ||
], | ||
"title": "Generate Queue Length", | ||
"type": "timeseries" | ||
}, | ||
{ | ||
"datasource": { | ||
"type": "redis-datasource", | ||
"uid": "PA7F6415749A3297A" | ||
}, | ||
"description": "", | ||
"fieldConfig": { | ||
"defaults": { | ||
"color": { | ||
"mode": "palette-classic" | ||
}, | ||
"custom": { | ||
"axisLabel": "", | ||
"axisPlacement": "auto", | ||
"barAlignment": 0, | ||
"drawStyle": "line", | ||
"fillOpacity": 0, | ||
"gradientMode": "none", | ||
"hideFrom": { | ||
"legend": false, | ||
"tooltip": false, | ||
"viz": false | ||
}, | ||
"lineInterpolation": "linear", | ||
"lineWidth": 1, | ||
"pointSize": 5, | ||
"scaleDistribution": { | ||
"type": "linear" | ||
}, | ||
"showPoints": "auto", | ||
"spanNulls": false, | ||
"stacking": { | ||
"group": "A", | ||
"mode": "none" | ||
}, | ||
"thresholdsStyle": { | ||
"mode": "off" | ||
} | ||
}, | ||
"mappings": [], | ||
"thresholds": { | ||
"mode": "absolute", | ||
"steps": [ | ||
{ | ||
"color": "green", | ||
"value": null | ||
}, | ||
{ | ||
"color": "red", | ||
"value": 80 | ||
} | ||
] | ||
} | ||
}, | ||
"overrides": [] | ||
}, | ||
"gridPos": { | ||
"h": 9, | ||
"w": 12, | ||
"x": 12, | ||
"y": 0 | ||
}, | ||
"id": 3, | ||
"options": { | ||
"legend": { | ||
"calcs": [], | ||
"displayMode": "list", | ||
"placement": "bottom" | ||
}, | ||
"tooltip": { | ||
"mode": "single", | ||
"sort": "none" | ||
} | ||
}, | ||
"targets": [ | ||
{ | ||
"command": "llen", | ||
"datasource": { | ||
"type": "redis-datasource", | ||
"uid": "PA7F6415749A3297A" | ||
}, | ||
"keyName": "results", | ||
"query": "", | ||
"refId": "A", | ||
"streaming": true, | ||
"type": "command" | ||
} | ||
], | ||
"title": "Result Queue Length", | ||
"type": "timeseries" | ||
} | ||
], | ||
"schemaVersion": 36, | ||
"style": "dark", | ||
"tags": [], | ||
"templating": { | ||
"list": [] | ||
}, | ||
"time": { | ||
"from": "now-6h", | ||
"to": "now" | ||
}, | ||
"timepicker": {}, | ||
"timezone": "", | ||
"title": "Instruct Lab Bot", | ||
"uid": "EDm3MDJIz", | ||
"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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: "3.4" | ||
|
||
services: | ||
redis: | ||
container_name: redis | ||
image: redis:latest | ||
ports: | ||
- 6379:6379 | ||
|
||
grafana: | ||
container_name: grafana | ||
image: ghcr.io/redisgrafana/redis-app:latest | ||
ports: | ||
- 3333:3000 | ||
environment: | ||
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin | ||
- GF_AUTH_ANONYMOUS_ENABLED=true | ||
- GF_AUTH_BASIC_ENABLED=false | ||
- GF_ENABLE_GZIP=true | ||
- GF_USERS_DEFAULT_THEME=light | ||
volumes: | ||
- ./provisioning:/etc/grafana/provisioning | ||
- ./dashboards:/etc/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,9 @@ | ||
apiVersion: 1 | ||
|
||
providers: | ||
- name: dashboards | ||
type: file | ||
updateIntervalSeconds: 30 | ||
options: | ||
path: /etc/dashboards | ||
foldersFromFilesStructure: true |
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,21 @@ | ||
apiVersion: 1 | ||
|
||
deleteDatasources: | ||
- name: Redis | ||
orgId: 1 | ||
|
||
datasources: | ||
- name: Redis | ||
type: redis-datasource | ||
access: proxy | ||
orgId: 1 | ||
isDefault: true | ||
version: 1 | ||
url: redis://redis:6379 | ||
jsonData: | ||
client: standalone | ||
poolSize: 5 | ||
timeout: 10 | ||
pingInterval: 0 | ||
pipelineWindow: 0 | ||
editable: true |
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