Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k8s otel-collector #177

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions build/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# OTEL collector
OTEL_GRPC_PORT="4317"
OTEL_HTTP_PORT="4318"
OTEL_PROMETHEUS_EXPORTER="8889"

# Prometheus
PROMETHEUS_PORT="9090"
PROMETHEUS_URL="http://46.101.22.123:${PROMETHEUS_PORT}"
# PROMETHEUS_URL="https://<userid>:<API_KEY>@prometheus-prod-10-prod-us-central-0.grafana.net/api/prom"

# Celestia Core/App
DENOM="utia"
VALIDATOR_KEY="validator"
CHAINID="private"
KEYRING_BACKEND="test"
APP_HOME_DIR="/root/.celestia-app"
CORE_IP="celestia-app"
CORE_RPC_PORT="26657"
CORE_GRPC_PORT="9092"
APP_NODE_GRPC_TLS="false"

NODE_EXPORTED_KEY_FILE_POSTFIX="_nodeKey.txt"

# Valuter
VALUTER_PORT=8080
VALUTER_SERVING_ADDR=:${VALUTER_PORT}

# Database
POSTGRES_DB=celestiadb
POSTGRES_USER=root
POSTGRES_PASSWORD=password
POSTGRES_PORT=5432
POSTGRES_HOST=postgres
PGADMIN_PORT=5555


# Nodelogger
NODELOGGER_LOG_LEVEL="info"
# in seconds
NODELOGGER_PROMETHEUS_SYNC_INTERVAL=30
NODELOGGER_API_ROWS_PER_PAGE=100
NODELOGGER_REST_API_PORT="5050"
NODELOGGER_REST_API_ADDRESS=":${NODELOGGER_REST_API_PORT}"
NODELOGGER_DEMO="false"
NODELOGGER_ORIGIN_ALLOWED="*"

# Leaderboard
LEADERBOARD_LOG_LEVEL="info"
LEADERBOARD_API_CALL_RETRY=20
LEADERBOARD_API_CALL_TIMEOUT=60
LEADERBOARD_PROMETHEUS_SYNC_INTERVAL=30
LEADERBOARD_VALIDATOR_SYNC_INTERVAL=60
LEADERBOARD_TENDERMINT_SYNC_INTERVAL=86400
LEADERBOARD_API_ROWS_PER_PAGE=100
LEADERBOARD_REST_API_PORT="5051"
LEADERBOARD_REST_API_ADDRESS=":${LEADERBOARD_REST_API_PORT}"
LEADERBOARD_IP_INFO_API_KEY="xxxxxxxxxxxx"
LEADERBOARD_DEMO="false"
LEADERBOARD_ORIGIN_ALLOWED="*"
100 changes: 81 additions & 19 deletions build/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
version: '3.7'

services:
loki:
container_name: loki
image: grafana/loki:2.6.1
expose:
- 3100
grafana:
image: grafana/grafana:9.2.4
ports:
- "3100:3100"
- 3000:3000
restart: unless-stopped
volumes:
- loki-data:/loki

promtail:
container_name: promtail
image: grafana/promtail:2.6.1
volumes:
# custom config will read logs from the containers of
# this project
- ${PWD}/promtail:/etc/promtail
# to read container labels and logs
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/containers:/var/lib/docker/containers
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- grafana-data:/var/lib/grafana

prometheus:
container_name: prometheus
Expand All @@ -47,6 +34,81 @@ services:
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP http receiver

# nodelogger:
# image: mojiz/nodelogger:latest
# container_name: nodelogger
# depends_on:
# - postgres
# ports:
# - 2348:2345
# - ${NODELOGGER_REST_API_PORT}:${NODELOGGER_REST_API_PORT}
# logging:
# driver: "json-file"
# options:
# max-size: "200k"
# max-file: "10"
# volumes:
# - ./nodelogger:/go/src/app # We need it for development
# environment:
# LOG_LEVEL: ${NODELOGGER_LOG_LEVEL}
# PROMETHEUS_URL: ${PROMETHEUS_URL}
# PROMETHEUS_SYNC_INTERVAL: ${NODELOGGER_PROMETHEUS_SYNC_INTERVAL}
# API_ROWS_PER_PAGE: ${NODELOGGER_API_ROWS_PER_PAGE}
# REST_API_ADDRESS: ${NODELOGGER_REST_API_ADDRESS}
# DEMO: ${NODELOGGER_DEMO:-true}
# ORIGIN_ALLOWED: ${NODELOGGER_ORIGIN_ALLOWED}
# POSTGRES_DB: ${POSTGRES_DB:-tmp}
# POSTGRES_USER: ${POSTGRES_USER:-root}
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
# POSTGRES_PORT: ${POSTGRES_PORT:-5432}
# POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
# healthcheck:
# test: curl --fail http://nodelogger:${NODELOGGER_REST_API_PORT}/ || exit 1
# interval: 30s
# retries: 10 # Will try for 5 minutes
# restart: always
# security_opt:
# - "seccomp:unconfined"
#
#
# postgres:
# container_name: postgres
# image: postgres:latest
# environment:
# POSTGRES_DB: ${POSTGRES_DB:-tmp}
# POSTGRES_USER: ${POSTGRES_USER:-root}
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
# POSTGRES_PORT: ${POSTGRES_PORT:-5432}
# POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
# volumes:
# - postgres-db:/var/lib/postgresql/data
# healthcheck:
# test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "root" ]
# timeout: 45s
# interval: 10s
# retries: 10
# restart: always
#
#
# #----------------#
#
# pgadmin:
# container_name: pgadmin
# image: dpage/pgadmin4
# depends_on:
# - postgres
# ports:
# - "${PGADMIN_PORT}:80"
# environment:
# PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
# PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
# PGADMIN_CONFIG_SERVER_MODE: 'False'
# volumes:
# - ./pgadmin:/root/.pgadmin
# restart: unless-stopped

volumes:
prometheus-data:
loki-data:
loki-data:
grafana-data:
# postgres-db:
6 changes: 6 additions & 0 deletions build/grafana/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
datasources:
- name: Prometheus
access: proxy
type: prometheus
url: http://0.0.0.0:9000
isDefault: true
Loading