Skip to content

Commit

Permalink
Code for step 5
Browse files Browse the repository at this point in the history
  • Loading branch information
akoutmos committed Jan 22, 2020
1 parent 6c6f811 commit fd8dc84
Show file tree
Hide file tree
Showing 9 changed files with 4,271 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docker-compose.yml
Expand Up @@ -35,7 +35,45 @@ services:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres

grafana:
image: grafana/grafana:6.3.3
depends_on:
- prometheus
ports:
- '3000:3000'
volumes:
- grafana-data:/var/lib/grafana
- ./docker/grafana/:/etc/grafana/provisioning/
env_file:
- ./docker/grafana/.env

prometheus:
image: prom/prometheus:v2.11.2
ports:
- '9090:9090'
volumes:
- ./docker/prometheus/:/etc/prometheus/
- prometheus-data:/prometheus
command:
- '--config.file=/etc/prometheus/config.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'

postgres_exporter:
image: wrouesnel/postgres_exporter:v0.5.1
ports:
- '9187:9187'
depends_on:
- postgres
environment:
DATA_SOURCE_USER: postgres
DATA_SOURCE_PASS: postgres
DATA_SOURCE_URI: postgres:5432/?sslmode=disable

volumes:
elixir-deps: {}
elixir-build: {}
postgres-data: {}
prometheus-data: {}
grafana-data: {}
3 changes: 3 additions & 0 deletions docker/grafana/.env
@@ -0,0 +1,3 @@
GF_SECURITY_ADMIN_PASSWORD=admin
GF_USERS_ALLOW_SIGN_UP=false
GF_INSTALL_PLUGINS=grafana-worldmap-panel
157 changes: 157 additions & 0 deletions docker/grafana/dashboards/app_dashboard.json
@@ -0,0 +1,157 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"description": "Dashboard for application specific Statistics.",
"editable": true,
"gnetId": null,
"graphTooltip": 1,
"links": [],
"panels": [
{
"cards": {
"cardPadding": null,
"cardRound": null
},
"color": {
"cardColor": "#b4ff00",
"colorScale": "sqrt",
"colorScheme": "interpolateOranges",
"exponent": 0.5,
"mode": "spectrum"
},
"dataFormat": "tsbuckets",
"datasource": "prometheus",
"description": "Within what radius are users commonly searching",
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 0
},
"heatmap": {},
"hideZeroBuckets": true,
"highlightCards": true,
"id": 4,
"legend": {
"show": false
},
"options": {},
"reverseYBuckets": false,
"targets": [
{
"expr": "sum(increase(elixir_app_radius_search_bucket[5m])) by (le)",
"format": "heatmap",
"instant": false,
"legendFormat": "{{ le }}",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Zip code search radius",
"tooltip": {
"show": true,
"showHistogram": false
},
"type": "heatmap",
"xAxis": {
"show": true
},
"xBucketNumber": null,
"xBucketSize": null,
"yAxis": {
"decimals": null,
"format": "lengthmi",
"logBase": 1,
"max": null,
"min": null,
"show": true,
"splitFactor": null
},
"yBucketBound": "auto",
"yBucketNumber": null,
"yBucketSize": null
},
{
"circleMaxSize": "10",
"circleMinSize": "2",
"colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"],
"datasource": "prometheus",
"decimals": 0,
"description": "Within what zip codes are users commonly searching",
"esMetric": "Count",
"gridPos": {
"h": 16,
"w": 24,
"x": 0,
"y": 12
},
"hideEmpty": false,
"hideZero": false,
"id": 2,
"initialZoom": "7",
"locationData": "table",
"mapCenter": "custom",
"mapCenterLatitude": "47.4",
"mapCenterLongitude": "-120.7401",
"maxDataPoints": 1,
"mouseWheelZoom": true,
"options": {},
"showLegend": false,
"stickyLabels": false,
"tableQueryOptions": {
"geohashField": "geohash",
"labelField": "zip_code",
"latitudeField": "latitude",
"longitudeField": "longitude",
"metricField": "Value",
"queryType": "geohash"
},
"targets": [
{
"expr": "elixir_app_zip_code_search",
"format": "table",
"instant": true,
"refId": "A"
}
],
"thresholds": "0,10",
"timeFrom": null,
"timeShift": null,
"title": "Zip code search map",
"type": "grafana-worldmap-panel",
"unitPlural": "",
"unitSingle": "",
"valueName": "total"
}
],
"refresh": "5s",
"schemaVersion": 19,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"]
},
"timezone": "",
"title": "Brewery Search",
"uid": "vuTsSjdWk",
"version": 3
}

0 comments on commit fd8dc84

Please sign in to comment.