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

Introduce prometheus #110

Merged
merged 9 commits into from
Aug 7, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
suite: [server, worker]
suite: [server] #, worker]
include:
- suite: server
build: cargo build --release
Expand Down
1 change: 1 addition & 0 deletions etc/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OPENSEA_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1 change: 1 addition & 0 deletions etc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
17 changes: 17 additions & 0 deletions etc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Running enstate with docker-compose

To get started you can clone this repository, enter this folder and run:

```sh
docker compose up
```

This will start a redis instance, an enstate instance and a prometheus instance.

You can adjust final tweaks inside of the `.env` file (see `.env.example` for an example).

## Grafana

The grafana portal is accessible at [http://localhost:3000](http://localhost:3000).

You can login with the default credentials `admin`/`admin`.
61 changes: 61 additions & 0 deletions etc/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: 'enstate'

services:
enstate:
image: ghcr.io/v3xlabs/enstate:latest
ports:
- "8000:8000"
volumes:
- ./data:/data
environment:
- PORT=8000
- UNIVERSAL_RESOLVER=0x8cab227b1162f03b8338331adaad7aadc83b895e
- REDIS_URL=redis://redis:6379
- RPC_URL=https://rpc.ankr.com/eth
env_file: .env

redis:
image: redis:6.0.9-alpine
ports:
- "6379:6379"

prometheus:
restart: unless-stopped
image: prom/prometheus
depends_on:
- enstate
ports:
- 9090:9090
volumes:
- ./prometheus/:/etc/prometheus/
- prometheusdata:/prometheus
command:
- --config.file=/etc/prometheus/prometheus.yaml
- --storage.tsdb.path=/prometheus

grafana:
restart: unless-stopped
image: grafana/grafana:latest
depends_on:
- enstate
- prometheus
ports:
- 3000:3000
environment:
PROMETHEUS_URL: http://prometheus:9090
volumes:
- grafanadata:/var/lib/grafana
- ./grafana/datasources:/etc/grafana/provisioning/datasources
- ./grafana/dashboards:/etc/grafana/provisioning_temp/dashboards
entrypoint: >
sh -c "cp -r /etc/grafana/provisioning_temp/dashboards/. /etc/grafana/provisioning/dashboards &&
find /etc/grafana/provisioning/dashboards/ -name '*.json' -exec sed -i 's/$${DS_PROMETHEUS}/Prometheus/g' {} \+ &&
/run.sh"

volumes:
logs:
driver: local
prometheusdata:
driver: local
grafanadata:
driver: local
7 changes: 7 additions & 0 deletions etc/grafana/dashboards/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: 1

providers:
- name: 'Folder'
allowUiUpdates: true
options:
path: /etc/grafana/provisioning/dashboards
Loading
Loading