Skip to content

Commit

Permalink
Merge pull request #121 from tensorplex-labs/chore/loki-logging
Browse files Browse the repository at this point in the history
chore: loki logging
  • Loading branch information
jarvis8x7b authored Feb 10, 2025
2 parents 391b7c1 + e97db3d commit b059666
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .env.validator.example
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ DB_NAME=db
DB_USERNAME=
DB_PASSWORD=
DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}


#dojo loki
DOJO_LOKI_URL=<GET_FROM_TPLX_TEAM>
# hotkey for loki external label
VALIDATOR_HOTKEY=
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ For Docker Compose installation, see https://docs.docker.com/compose/install/lin
# verify both docker and docker compose are installed
docker --version
docker compose version

# for validator please install docker loki plugin
docker plugin install grafana/loki-docker-driver:3.3.2-amd64 --alias loki --grant-all-permissions
```

4. Start local subtensor node (**optional**)
Expand Down Expand Up @@ -438,6 +441,10 @@ DB_NAME=db
DB_USERNAME=#set a non-default username
DB_PASSWORD=#generate and set a secure password
DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}

# dojo loki
DOJO_LOKI_URL=# get from TPLX TEAM
VALIDATOR_HOTKEY=# your running validator hotkey address
```

> **Note:** To ensure your validator runs smoothly, enable the auto top-up feature for Openrouter, this ensures that your validator will not fail to call synthetic API during task generation. The estimate cost of generating a task is approximately $0.20 USD.
Expand Down
7 changes: 6 additions & 1 deletion docker-compose.validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ services:
condition: service_healthy
prisma-setup-vali:
condition: service_completed_successfully
logging: *default-logging
logging:
driver: loki
options:
mode: non-blocking
loki-url: "https://${DOJO_LOKI_URL}"
loki-external-labels: "validator=${VALIDATOR_HOTKEY}"

dataset-service:
container_name: dataset-service
Expand Down

0 comments on commit b059666

Please sign in to comment.