Skip to content

Commit

Permalink
add sample config for grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
wakeful committed Oct 15, 2017
1 parent 4995e84 commit 7d3e712
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ services:
GF_INSTALL_PLUGINS: "grafana-piechart-panel"
ports:
- "3000:3000"
grafana_config:
build: ./grafana_config
selenium_grid_exporter:
build: .
command: "--scrape-uri http://hub:4444"
Expand Down
9 changes: 9 additions & 0 deletions grafana_config/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM alpine:3.6

WORKDIR /grafana_config
COPY . .

RUN apk add --no-cache curl
RUN chmod +x /grafana_config/wait.sh

ENTRYPOINT ["/grafana_config/wait.sh"]
7 changes: 7 additions & 0 deletions grafana_config/prometheus_datasource.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name":"prometheus",
"type":"prometheus",
"url":"http://prometheus:9090",
"access":"proxy",
"basicAuth":false
}
150 changes: 150 additions & 0 deletions grafana_config/selenium_grid_dashboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"dashboard": {
"annotations": {
"list": []
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"hideControls": false,
"id": null,
"links": [],
"rows": [
{
"collapse": false,
"height": "250px",
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "prometheus",
"fill": 1,
"id": 1,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"span": 12,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "selenium_grid_hub_slotsTotal",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "Total",
"refId": "A",
"step": 2
},
{
"expr": "selenium_grid_hub_slotsFree",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "Free",
"refId": "B",
"step": 2
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Slots",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 0,
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
}
],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": false,
"title": "Dashboard Row",
"titleSize": "h6"
}
],
"schemaVersion": 14,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "",
"title": "Selenium Grid",
"version": 1
}
}
7 changes: 7 additions & 0 deletions grafana_config/wait.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

while ! curl --output /dev/null --silent --head --fail http://grafana:3000; do sleep 1 && echo -n .; done;

curl -v -H "Content-Type: application/json" -X POST -d @prometheus_datasource.json http://grafana:3000/api/datasources

curl -v -H "Content-Type: application/json" -X POST -d @selenium_grid_dashboard.json http://grafana:3000/api/dashboards/db

0 comments on commit 7d3e712

Please sign in to comment.