Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
adds example stack
Browse files Browse the repository at this point in the history
this contains prometheus,grafana and aleph-exporter
Should fix #6
  • Loading branch information
Christoph Klünter committed Jun 8, 2020
1 parent 397d16e commit c263125
Show file tree
Hide file tree
Showing 8 changed files with 380 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contrib/prometheus-grafana-alephexporter-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Example docker-compose setup
To run this, edit aleph-exporter.env and set the url to aleph and the token
Then run `docker-compose up`
You should get prometheus at [localhost:9090](localhost:9090) and grafana at [localhost:3000](localhost:3000)
Password for grafana is admin/admin
The aleph dashboard is installed automatically
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALEPH_HOST=localhost
ALEPH_TOKEN=SOME_TOKEN
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: '3.2'
volumes:
grafana_data: {}
prometheus_data: {}
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: always
command:
- --config.file=/etc/prometheus/prometheus.yml
- --web.enable-lifecycle
- --storage.tsdb.path=/prometheus
volumes:
- type: bind
source: ./prometheus/prometheus.yml
target: /etc/prometheus/prometheus.yml
- type: volume
source: prometheus_data
target: /prometheus
ports:
- 9090:9090
grafana:
image: grafana/grafana
container_name: grafana
restart: always
volumes:
- grafana_data:/var/lib/grafana
- type: bind
source: ./grafana/provisioning/
target: /etc/grafana/provisioning/
- type: bind
source: ./grafana/dashboards/
target: /var/lib/grafana/dashboards
environment:
- GF_SECURITY_ADMIN_PASSWORD
env_file:
- ./grafana/grafana.config
ports:
- 3000:3000
aleph_exporter:
image: ckluenter/alephexporter:latest
container_name: alephexporter
ports:
- "8080:8080"
env_file:
- aleph-exporter.env

Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
{
"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": 41,
"links": [],
"panels": [
{
"cacheTimeout": null,
"colorBackground": true,
"colorValue": false,
"colors": [
"#d44a3a",
"rgba(237, 129, 40, 0.89)",
"#299c46"
],
"datasource": null,
"format": "none",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 3,
"w": 24,
"x": 0,
"y": 0
},
"id": 4,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false,
"ymax": null,
"ymin": null
},
"tableColumn": "",
"targets": [
{
"expr": "aleph_up{instance=\"${instance}\"}",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"thresholds": "0.1,1",
"timeFrom": null,
"timeShift": null,
"title": "Api Status",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "UP",
"value": "1"
},
{
"op": "=",
"text": "DOWN",
"value": "0"
}
],
"valueName": "current"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 3
},
"hiddenSeries": false,
"id": 2,
"legend": {
"alignAsTable": true,
"avg": false,
"current": true,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"sort": "current",
"sortDesc": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "aleph_job_status{stage!=\"finished\",instance=\"${instance}\"}",
"interval": "",
"legendFormat": "{{ collection_name }} - {{ stage_task }} - {{ stage }}",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Aleph Job Queue",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"schemaVersion": 22,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"datasource": "Prometheus",
"definition": "label_values(aleph_up, instance)",
"hide": 0,
"includeAll": false,
"index": -1,
"label": null,
"multi": false,
"name": "instance",
"query": "label_values(aleph_up, instance)",
"refresh": 0,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
]
},
"timezone": "",
"title": "Aleph Exporter Example",
"variables": {
"list": []
},
"version": 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GF_SECURITY_DISABLE_GRAVATAR=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: 1

providers:
- name: 'default'
orgId: 1
folder: ''
type: file
disableDeletion: false
allowUiUpdates: false
editable: false
options:
path: /var/lib/grafana/dashboards
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# config file version
apiVersion: 1

# list of datasources that should be deleted from the database
deleteDatasources:
- name: Prometheus
orgId: 1

# list of datasources to insert/update depending
# whats available in the database
datasources:
# <string, required> name of the datasource. Required
- name: Prometheus
# <string, required> datasource type. Required
type: prometheus
# <string, required> access mode. direct or proxy. Required
access: proxy
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string> url
url: http://prometheus:9090/prometheus/
# <string> database password, if used
password:
# <string> database user, if used
user:
# <string> database name, if used
database:
# <bool> enable/disable basic auth
basicAuth: false
# <string> basic auth username, if used
basicAuthUser:
# <string> basic auth password, if used
basicAuthPassword:
# <bool> enable/disable with credentials headers
withCredentials:
# <bool> mark as default datasource. Max one per org
isDefault: true
# <map> fields that will be converted to json and stored in json_data
jsonData:
graphiteVersion: "1.1"
tlsAuth: false
tlsAuthWithCACert: false
# <string> json object of data that will be encrypted.
secureJsonData:
tlsCACert: "..."
tlsClientCert: "..."
tlsClientKey: "..."
version: 1
# <bool> allow users to edit datasources from the UI.
editable: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
scrape_configs:
- job_name: 'aleph'
static_configs:
- targets:
- alephexporter:8080

0 comments on commit c263125

Please sign in to comment.