Skip to content

Commit

Permalink
Add logs to grafana for all clients and services
Browse files Browse the repository at this point in the history
  • Loading branch information
gathecageorge authored Feb 9, 2022
1 parent a03bc26 commit a19fba1
Show file tree
Hide file tree
Showing 26 changed files with 146 additions and 0 deletions.
1 change: 1 addition & 0 deletions besu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
execution:
Expand Down
1 change: 1 addition & 0 deletions blox-ssv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
ssv-node:
Expand Down
1 change: 1 addition & 0 deletions erigon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
erigon:
Expand Down
1 change: 1 addition & 0 deletions geth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
execution:
Expand Down
33 changes: 33 additions & 0 deletions grafana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
prometheus:
Expand Down Expand Up @@ -84,6 +85,35 @@ services:
expose:
- 9745/tcp
<<: *logging
promtail:
image: grafana/promtail:latest
user: root
ports:
- 9080:9080
- 9081:9081
volumes:
- /etc/machine-id:/etc/machine-id:ro
- ./promtail:/etc/promtail
- promtail-data:/tmp
- /var/lib/docker/containers:/var/lib/docker/containers:ro
command:
- '--config.file=/etc/promtail/promtail.yml'
restart: "${RESTART}"
depends_on:
- loki
<<: *logging
loki:
image: grafana/loki:latest
ports:
- 3100:3100
- 9096:9096
volumes:
- loki-data:/tmp
- ./loki:/etc/loki
command:
- '--config.file=/etc/loki/loki.yml'
restart: "${RESTART}"
<<: *logging
grafana:
restart: "${RESTART}"
build:
Expand All @@ -98,6 +128,7 @@ services:
- /etc/localtime:/etc/localtime:ro
depends_on:
- prometheus
- loki
expose:
- ${GRAFANA_PORT}/tcp
entrypoint: ["provision-dashboards.sh"]
Expand All @@ -116,3 +147,5 @@ volumes:
grafana-data:
grafana-config:
prom-data:
loki-data:
promtail-data:
13 changes: 13 additions & 0 deletions grafana/datasource.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ deleteDatasources:
- name: Prometheus
orgId: 1

- name: Loki
orgId: 1

# list of datasources to insert/update depending
# whats available in the database
datasources:
Expand All @@ -18,3 +21,13 @@ datasources:
isDefault: true
version: 1
editable: true

- name: Loki
type: loki
access: proxy
orgId: 1
url: http://loki:3100
basicAuth: false
isDefault: false
version: 1
editable: true
1 change: 1 addition & 0 deletions lh-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
consensus:
Expand Down
1 change: 1 addition & 0 deletions lh-consensus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
consensus:
Expand Down
1 change: 1 addition & 0 deletions lh-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
validator:
Expand Down
1 change: 1 addition & 0 deletions lodestar-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
consensus:
Expand Down
1 change: 1 addition & 0 deletions lodestar-consensus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
consensus:
Expand Down
1 change: 1 addition & 0 deletions lodestar-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
validator:
Expand Down
28 changes: 28 additions & 0 deletions loki/loki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
auth_enabled: false

server:
http_listen_port: 3100
grpc_listen_port: 9096

common:
path_prefix: /tmp/loki
storage:
filesystem:
chunks_directory: /tmp/loki/chunks
rules_directory: /tmp/loki/rules
replication_factor: 1
ring:
instance_addr: 127.0.0.1
kvstore:
store: inmemory

schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h

1 change: 1 addition & 0 deletions nimbus-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
consensus:
Expand Down
1 change: 1 addition & 0 deletions nimbus-consensus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
consensus:
Expand Down
1 change: 1 addition & 0 deletions nm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
execution:
Expand Down
50 changes: 50 additions & 0 deletions promtail/promtail.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
server:
http_listen_port: 9080
grpc_listen_port: 9081
log_level: warn

positions:
filename: /tmp/positions.yaml

clients:
- url: http://loki:3100/loki/api/v1/push

scrape_configs:
- job_name: containers
static_configs:
- targets:
- localhost
labels:
job: containerlogs
__path__: /var/lib/docker/containers/*/*log

pipeline_stages:
- json:
expressions:
output: log
stream: stream
attrs:

- json:
expressions:
tag:
source: attrs

- regex:
expression: (?P<image_name>(?:[^|]*[^|])).(?P<container_name>(?:[^|]*[^|])).(?P<image_id>(?:[^|]*[^|])).(?P<container_id>(?:[^|]*[^|]))
source: tag

- timestamp:
format: RFC3339Nano
source: time

- labels:
stream:
container_name:

- labeldrop:
- filename

- output:
source: output

1 change: 1 addition & 0 deletions prysm-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &prysm-build
context: ./prysm
Expand Down
1 change: 1 addition & 0 deletions prysm-consensus-rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &prysm-build
context: ./prysm
Expand Down
1 change: 1 addition & 0 deletions prysm-consensus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &prysm-build
context: ./prysm
Expand Down
1 change: 1 addition & 0 deletions prysm-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &prysm-build
context: ./prysm
Expand Down
1 change: 1 addition & 0 deletions teku-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
consensus:
Expand Down
1 change: 1 addition & 0 deletions teku-consensus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
consensus:
Expand Down
1 change: 1 addition & 0 deletions teku-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
validator:
Expand Down
1 change: 1 addition & 0 deletions traefik-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
traefik:
Expand Down
1 change: 1 addition & 0 deletions traefik-cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-logging: &logging
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
traefik:
Expand Down

0 comments on commit a19fba1

Please sign in to comment.