Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into add_open_api_spex_bea…
Browse files Browse the repository at this point in the history
…con_endpoints
  • Loading branch information
f3r10 committed Jan 18, 2024
2 parents 1bd8984 + 82f2e00 commit 4abe6e5
Show file tree
Hide file tree
Showing 9 changed files with 466 additions and 246 deletions.
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,20 @@ priv
.vscode/

# spec-test vectors
test/spec/vectors
/test/spec/vectors

native/libp2p_port/libp2p_port
/native/libp2p_port/libp2p_port

# Proto generated code.
*.pb.ex
*.pb.go

# local db.
level_db
/level_db
/logs

# Generated tests
test/generated
/test/generated

# profiling artifacts
callgrind.out.*
Expand Down
25 changes: 25 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ import Config
# Configure logging
config :logger, level: :info, truncate: :infinity

# # Uncomment to log to a file
# # TODO: we might want to enable this with a CLI flag
# config :logger, :default_handler,
# config: [
# file: ~c"logs/system.log",
# filesync_repeat_interval: 5000,
# file_check: 5000,
# max_no_bytes: 10_000_000,
# max_no_files: 5,
# compress_on_rotate: true
# ]

# # NOTE: We want to log UTC timestamps, for convenience
# config :logger, utc_log: true

# config :logger, :default_formatter,
# format: {LogfmtEx, :format},
# colors: [enabled: false],
# metadata: [:mfa]

# config :logfmt_ex, :opts,
# message_key: "msg",
# timestamp_key: "ts",
# timestamp_format: :iso8601

# Configures the phoenix endpoint
config :lambda_ethereum_consensus, BeaconApi.Endpoint,
http: [port: 4000],
Expand Down
74 changes: 68 additions & 6 deletions metrics/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
version: '0.1'
version: '3'
name: 'lambda-ethereum-consensus-grafana'

services:
prometheus:
image: prom/prometheus
container_name: prometheus
hostname: prometheus
ports:
- "9090:9090"
volumes:
# prometheus configuration
- ./prometheus:/etc/prometheus
# prometheus data
- prometheus-data:/prometheus
command: --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml
networks:
open:
grafana-prometheus:
aliases:
- prometheus
extra_hosts:
Expand All @@ -25,17 +25,79 @@ services:
ports:
- "3000:3000"
volumes:
# grafana configuration
- ./grafana/provisioning:/etc/grafana/provisioning
# grafana data
- grafana-data:/var/lib/grafana
environment:
# WARNING: use this for same-machine access ONLY
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_DISABLE_LOGIN_FORM: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin"
networks:
open:
grafana-prometheus:
aliases:
- grafana
grafana-loki:
aliases:
- grafana

# Since the Loki containers are running as user 10001 and the mounted data volume is owned by root,
# Loki would not have permissions to create the directories.
# Therefore the init container changes permissions of the mounted directory.
loki-init:
image: &lokiImage grafana/loki:2.9.2
user: root
entrypoint:
- "chown"
- "10001:10001"
- "/tmp/loki"
volumes:
- loki-data:/tmp/loki

loki:
image: *lokiImage
container_name: loki
volumes:
# loki configuration
- ./loki:/etc/loki
# loki data
- loki-data:/tmp/loki
command: --config.file=/etc/loki/loki.yml
networks:
grafana-loki:
aliases:
- loki
loki-promtail:
aliases:
- loki

promtail:
image: grafana/promtail
container_name: promtail
volumes:
# promtail configuration
- ./promtail:/etc/promtail
# logs to scrape
- ../logs:/var/log/consensus
# promtail data
- promtail-data:/tmp/promtail
command: --config.file=/etc/promtail/promtail.yml
networks:
loki-promtail:
aliases:
- promtail

networks:
open:
grafana-prometheus:
driver: bridge
grafana-loki:
driver: bridge
loki-promtail:
driver: bridge

volumes:
prometheus-data:
grafana-data:
loki-data:
promtail-data:
Loading

0 comments on commit 4abe6e5

Please sign in to comment.