Integrate grafana/prometheus with fixturenet-eth. (#156)

* Integrate grafana/prometheus with fixturenet-eth.

* Integrate grafana/prometheus with fixturenet-eth.

* Revert port change

* EOL

* EOL

* Simplify ipld-eth-server config.

Former-commit-id: c279bd49a4
This commit is contained in:
Thomas E Lackey 2023-01-25 11:50:08 -06:00 committed by GitHub
parent d0d29717e1
commit b5c7ad114c
11 changed files with 1222 additions and 53 deletions

View File

@ -0,0 +1,21 @@
version: "3.2"
services:
prometheus:
restart: always
image: prom/prometheus
depends_on:
fixturenet-eth-geth-1:
condition: service_healthy
volumes:
- ../config/fixturenet-eth-metrics/prometheus/etc:/etc/prometheus
ports:
- "9090"
grafana:
restart: always
image: grafana/grafana
volumes:
- ../config/fixturenet-eth-metrics/grafana/etc/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ../config/fixturenet-eth-metrics/grafana/etc/provisioning/datasources:/etc/grafana/provisioning/datasources
- ../config/fixturenet-eth-metrics/grafana/etc/dashboards:/etc/grafana/dashboards
ports:
- "3000"

View File

@ -20,16 +20,24 @@ services:
DATABASE_USER: "vdbm"
DATABASE_PASSWORD: "password"
ETH_CHAIN_ID: 99
ETH_FORWARD_ETH_CALLS: $eth_forward_eth_calls
ETH_PROXY_ON_ERROR: $eth_proxy_on_error
ETH_HTTP_PATH: $eth_http_path
ETH_FORWARD_ETH_CALLS: "false"
ETH_FORWARD_GET_STORAGE_AT: "false"
ETH_PROXY_ON_ERROR: "false"
METRICS: "true"
PROM_HTTP: "true"
PROM_HTTP_ADDR: "0.0.0.0"
PROM_HTTP_PORT: "8090"
LOGRUS_LEVEL: "debug"
CERC_REMOTE_DEBUG: "true"
volumes:
- type: bind
source: ../config/ipld-eth-server/chain.json
target: /tmp/chain.json
ports:
- "127.0.0.1:8081:8081"
- "127.0.0.1:8082:8082"
- "8081"
- "8082"
- "8090"
- "40000"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "8081"]
interval: 20s

View File

@ -29,9 +29,17 @@ services:
condition: service_healthy
keycloak-nginx:
image: nginx:1.23-alpine
restart: always
volumes:
- ../config/keycloak/nginx:/etc/nginx/conf.d
ports:
- 80
depends_on:
- keycloak
keycloak-nginx-prometheus-exporter:
image: nginx/nginx-prometheus-exporter
restart: always
environment:
- SCRAPE_URI=http://keycloak-nginx:80/stub_status
depends_on:
- keycloak-nginx

View File

@ -1,21 +0,0 @@
version: "3.2"
services:
# If you want prometheus to work, you must update the following file in the ops repo locally.
# localhost:6060 --> go-ethereum:6060
prometheus:
restart: always
user: "987"
image: prom/prometheus
volumes:
- ${cerc_ops}/metrics/etc:/etc/prometheus
- ./prometheus-data:/prometheus
ports:
- "127.0.0.1:9090:9090"
grafana:
restart: always
user: "472"
image: grafana/grafana
volumes:
- ./grafana-data:/var/lib/grafana
ports:
- "127.0.0.1:3000:3000"

View File

@ -0,0 +1,9 @@
apiVersion: 1
providers:
- name: dashboards
type: file
updateIntervalSeconds: 10
options:
path: /etc/grafana/dashboards
foldersFromFilesStructure: true

View File

@ -0,0 +1,19 @@
apiVersion: 1
datasources:
- id: 1
uid: jZUuGao4k
orgId: 1
name: Prometheus
type: prometheus
typeName: Prometheus
typeLogoUrl: public/app/plugins/datasource/prometheus/img/prometheus_logo.svg
access: proxy
url: http://prometheus:9090
user: ""
database: ""
basicAuth: false
isDefault: true
jsonData:
httpMethod: POST
readOnly: false

View File

@ -0,0 +1,34 @@
global:
scrape_interval: 5s
evaluation_interval: 15s
scrape_configs:
# ipld-eth-server
- job_name: 'ipld-eth-server'
metrics_path: /metrics
scrape_interval: 5s
static_configs:
- targets: ['ipld-eth-server:8090']
# geth
- job_name: 'geth'
metrics_path: /debug/metrics/prometheus
scheme: http
static_configs:
- targets: ['fixturenet-eth-geth-1:6060']
# nginx
- job_name: 'nginx'
scrape_interval: 5s
metrics_path: /metrics
scheme: http
static_configs:
- targets: ['keycloak-nginx-prometheus-exporter:9113']
# keycloak
- job_name: 'keycloak'
scrape_interval: 5s
metrics_path: /auth/realms/cerc/metrics
scheme: http
static_configs:
- targets: ['keycloak:8080']

View File

@ -21,19 +21,19 @@ server {
}
## ipld-eth-server
location ~ ^/ipld/eth/([^/]*)$ {
set $apiKey $1;
if ($apiKey = '') {
set $apiKey $http_X_API_KEY;
}
auth_request /auth;
auth_request_set $user_id $sent_http_x_user_id;
proxy_buffering off;
rewrite /.*$ / break;
proxy_pass http://ipld-eth-server:8081;
proxy_set_header X-Original-Remote-Addr $remote_addr;
proxy_set_header X-User-Id $user_id;
}
# location ~ ^/ipld/eth/([^/]*)$ {
# set $apiKey $1;
# if ($apiKey = '') {
# set $apiKey $http_X_API_KEY;
# }
# auth_request /auth;
# auth_request_set $user_id $sent_http_x_user_id;
# proxy_buffering off;
# rewrite /.*$ / break;
# proxy_pass http://ipld-eth-server:8081;
# proxy_set_header X-Original-Remote-Addr $remote_addr;
# proxy_set_header X-User-Id $user_id;
# }
#
# location ~ ^/ipld/gql/([^/]*)$ {
# set $apiKey $1;
@ -45,14 +45,14 @@ server {
# rewrite /.*$ / break;
# proxy_pass http://ipld-eth-server:8082;
# }
#
### lighthouse
# location /beacon/ {
# set $apiKey $http_X_API_KEY;
# auth_request /auth;
# proxy_buffering off;
# proxy_pass http://fixturenet-eth-lighthouse-1:8001/;
# }
## lighthouse
location /beacon/ {
set $apiKey $http_X_API_KEY;
auth_request /auth;
proxy_buffering off;
proxy_pass http://fixturenet-eth-lighthouse-1:8001/;
}
location = /auth {
internal;
@ -66,7 +66,7 @@ server {
proxy_set_header X-Original-Host $host;
}
# location = /basic_status {
# stub_status;
# }
location = /stub_status {
stub_status;
}
}

View File

@ -8,12 +8,14 @@ LIGHTHOUSE_BASE_URL=${LIGHTHOUSE_BASE_URL}
GETH_BASE_URL=${GETH_BASE_URL}
if [ -z "$LIGHTHOUSE_BASE_URL" ]; then
LIGHTHOUSE_PORT=`docker ps -f "name=fixturenet-eth-lighthouse-1-1" --format "{{.Ports}}" | head -1 | cut -d':' -f2 | cut -d'-' -f1`
LIGHTHOUSE_CONTAINER=`docker ps -q -f "name=fixturenet-eth-lighthouse-1-1"`
LIGHTHOUSE_PORT=`docker port $LIGHTHOUSE_CONTAINER 8001 | cut -d':' -f2`
LIGHTHOUSE_BASE_URL="http://localhost:${LIGHTHOUSE_PORT}"
fi
if [ -z "$GETH_BASE_URL" ]; then
GETH_PORT=`docker ps -f "name=fixturenet-eth-geth-1-1" --format "{{.Ports}}" | head -1 | cut -d':' -f2 | cut -d'-' -f1`
GETH_CONTAINER=`docker ps -q -f "name=fixturenet-eth-geth-1-1"`
GETH_PORT=`docker port $GETH_CONTAINER 8545 | cut -d':' -f2`
GETH_BASE_URL="http://localhost:${GETH_PORT}"
fi

View File

@ -6,10 +6,10 @@ ipld-eth-beacon-db
ipld-eth-beacon-indexer
ipld-eth-server
lighthouse
prometheus-grafana
laconicd
fixturenet-laconicd
fixturenet-eth
fixturenet-eth-metrics
watcher-mobymask
watcher-erc20
watcher-erc721