Skip to content

Commit

Permalink
Add Nchan dashboard (#149)
Browse files Browse the repository at this point in the history
Add Nchan dashboard to Grafana #130.
  • Loading branch information
marein authored Oct 12, 2022
1 parent 4e650dd commit 937be51
Show file tree
Hide file tree
Showing 4 changed files with 441 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ services:
- "traefik.enable=true"
- "traefik.http.routers.nchan.priority=20"
- "traefik.http.routers.nchan.rule=PathPrefix(`/sse`)"
- "prometheus-job=nchan"
- "prometheus-port=81"
service-js-polyfill:
image: gamingplatform/service-js-polyfill
restart: on-failure
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ services:
- "traefik.enable=true"
- "traefik.http.routers.nchan.priority=20"
- "traefik.http.routers.nchan.rule=PathPrefix(`/sse`)"
- "prometheus-job=nchan"
- "prometheus-port=81"
service-js-polyfill:
image: gamingplatform/service-js-polyfill
restart: on-failure
Expand Down
361 changes: 361 additions & 0 deletions docker/grafana/dashboards/nchan.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,361 @@
{
"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"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"iteration": 1665434791783,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 12,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.5.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "rate(nchan_total_published_messages{job=\"nchan\", instance=\"$instance\"}[$__rate_interval])",
"refId": "A"
}
],
"title": "Incoming Messages / s",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"decimals": 2,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "decmbytes"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 12,
"x": 12,
"y": 0
},
"id": 6,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.5.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "nchan_shared_memory_used{job=\"nchan\", instance=\"$instance\"} / 1024",
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Shared Memory",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 8,
"x": 0,
"y": 6
},
"id": 4,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.5.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "nchan_stored_messages{job=\"nchan\", instance=\"$instance\"}",
"refId": "A"
}
],
"title": "Stored Messages",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 8,
"x": 8,
"y": 6
},
"id": 8,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.5.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "nchan_subscribers{job=\"nchan\", instance=\"$instance\"}",
"refId": "A"
}
],
"title": "Subscribers",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 8,
"x": 16,
"y": 6
},
"id": 9,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.5.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "nchan_channels{job=\"nchan\", instance=\"$instance\"}",
"refId": "A"
}
],
"title": "Channels",
"type": "stat"
}
],
"refresh": "5s",
"schemaVersion": 36,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "php-gaming-website_nchan_1",
"value": "php-gaming-website_nchan_1"
},
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"definition": "",
"hide": 0,
"includeAll": false,
"label": "Instance",
"multi": false,
"name": "instance",
"options": [],
"query": {
"query": "label_values(nchan_channels{job=\"nchan\"}, instance)",
"refId": "Prometheus-instance-Variable-Query"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-15m",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Nchan Overview",
"description": "Visualizes Nchan metrics.",
"uid": "EaeSxGIVk",
"version": 1,
"weekStart": ""
}
Loading

0 comments on commit 937be51

Please sign in to comment.