Skip to content

Commit

Permalink
docker files for metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikebbers committed Mar 31, 2018
1 parent 520212f commit 6768936
Show file tree
Hide file tree
Showing 8 changed files with 279 additions and 0 deletions.
14 changes: 14 additions & 0 deletions metrics-sample/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.3'
services:

prometheus:
build: './prometheus'
container_name: 'prometheus'
ports:
- '9090:9090'

grafana:
build: './grafana'
container_name: 'grafana'
ports:
- '3000:3000'
4 changes: 4 additions & 0 deletions metrics-sample/docker/grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM grafana/grafana:5.0.4
ADD ./provisioning /etc/grafana/provisioning
ADD ./config.ini /etc/grafana/config.ini
ADD ./dashboards /var/lib/grafana/dashboards
5 changes: 5 additions & 0 deletions metrics-sample/docker/grafana/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[paths]
provisioning = /etc/grafana/provisioning

[server]
enable_gzip = true
220 changes: 220 additions & 0 deletions metrics-sample/docker/grafana/dashboards/mydashboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": null,
"links": [],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "prometheus",
"fill": 1,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 0
},
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "system_cpu_usage",
"format": "time_series",
"intervalFactor": 1,
"refId": "A"
}
],
"thresholds": [],
"timeFrom": "10m",
"timeShift": null,
"title": "CPU Usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 0,
"format": "percentunit",
"label": "",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "prometheus",
"fill": 1,
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 0
},
"id": 4,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "jvm_memory_used_bytes",
"format": "time_series",
"intervalFactor": 1,
"refId": "A"
}
],
"thresholds": [],
"timeFrom": "10m",
"timeShift": null,
"title": "Memory usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "decbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
}
],
"schemaVersion": 16,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"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": "Basic Dashboard",
"uid": "aOXo8gmmk",
"version": 1
}
6 changes: 6 additions & 0 deletions metrics-sample/docker/grafana/provisioning/dashboards/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: 'default'
org_id: 1
folder: ''
type: 'file'
options:
folder: '/var/lib/grafana/dashboards'
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
datasources:
- name: 'prometheus'
type: 'prometheus'
access: 'proxy'
org_id: 1
url: 'http://prometheus:9090'
is_default: true
version: 1
editable: true
2 changes: 2 additions & 0 deletions metrics-sample/docker/prometheus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM prom/prometheus
ADD prometheus.yml /etc/prometheus/
19 changes: 19 additions & 0 deletions metrics-sample/docker/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
global:
scrape_interval: 2s
scrape_timeout: 1s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets: []
scheme: http
timeout: 10s
scrape_configs:
- job_name: prometheusdocker build -t my-prometheus .
scrape_interval: 2s
scrape_timeout: 1s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- docker.for.mac.host.internal:8080

0 comments on commit 6768936

Please sign in to comment.