Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
adria0 committed Jun 5, 2020
1 parent 6e967d6 commit 6665e8d
Show file tree
Hide file tree
Showing 8 changed files with 2,027 additions and 0 deletions.
705 changes: 705 additions & 0 deletions scripts/prometheus/config/grafana/grafana.ini

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions scripts/prometheus/config/grafana/loki.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: 1

datasources:
- name: Loki
type: loki
access: proxy
url: http://loki:3100
jsonData:
maxLines: 1000

50 changes: 50 additions & 0 deletions scripts/prometheus/config/grafana/prometheus.yaml
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
# <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
44 changes: 44 additions & 0 deletions scripts/prometheus/config/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090']

- job_name: openethereum
scrape_interval: 10s
metric_relabel_configs:
- source_labels: [__name__]
target_label: __name__
replacement: "oe_${1}"
static_configs:
- targets:
- 10.0.1.1:8545

- job_name: cadvisor
scrape_interval: 5s
static_configs:
- targets:
- 10.0.10.4:8080

18 changes: 18 additions & 0 deletions scripts/prometheus/config/promtail/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
server:
http_listen_port: 9080
grpc_listen_port: 0

positions:
filename: /tmp/positions.yaml

scrape_configs:
- job_name: openethereum
static_configs:
- targets:
- localhost
labels:
job: openethereum
__path__: /log/oe/*log



107 changes: 107 additions & 0 deletions scripts/prometheus/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
version: '3.5'
services:

openethereum:
image: openethereum:prometheus
restart: always
ports:
- '8545:8545'
- '30303:30303'
- '30303:30303/udp'
dns: 1.1.1.1
networks:
scnetwork:
ipv4_address: 10.0.1.1
volumes:
- /tmp/oe:/log
entrypoint: ./openethereum --no-warp --jsonrpc-port 8545 --jsonrpc-interface 10.0.1.1 --jsonrpc-hosts all

promtail:
image: grafana/promtail:latest
volumes:
- ./config/promtail/config.yaml:/etc/promtail/config.yaml
- /tmp/xdailogs:/log/xdai
command: -client.url=${LOKI_PUSH_URL} -config.file=/etc/promtail/config.yaml
dns: 1.1.1.1
networks:
scnetwork:
ipv4_address: 10.0.1.2
depends_on:
- openethereum

prometheus:
image: prom/prometheus
container_name: prometheus
restart: always
volumes:
- ./config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- '9090:9090'
dns: 1.1.1.1
networks:
scnetwork:
ipv4_address: 10.0.10.1
logging:
options:
max-size: 10m
max-file: '3'


loki:
image: grafana/loki
container_name: loki
restart: always
ports:
- '3100:3100'
dns: 1.1.1.1
networks:
scnetwork:
ipv4_address: 10.0.10.2
logging:
options:
max-size: 10m
max-file: '3'

grafana:
image: grafana/grafana
container_name: grafana
restart: always
volumes:
- ./config/grafana/grafana.ini:/etc/grafana/grafana.ini
- ./config/grafana/prometheus.yaml:/etc/grafana/provisioning/datasources/prometheus.yaml
- ./config/grafana/loki.yaml:/etc/grafana/provisioning/datasources/loki.yaml
ports:
- '3000:3000'
environment:
- GF_SECURITY_ADMIN_PASSWORD:secret
dns: 1.1.1.1
networks:
scnetwork:
ipv4_address: 10.0.10.3
logging:
options:
max-size: 10m
max-file: '3'

cadvisor:
image: google/cadvisor:latest
container_name: cadvisor
ports:
- 8080:8080
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
networks:
scnetwork:
ipv4_address: 10.0.10.4

networks:
scnetwork:
driver: bridge
ipam:
config:
- subnet: 10.0.0.0/16

Loading

0 comments on commit 6665e8d

Please sign in to comment.