Error tracking service
This repo contains all subrepos of Hawk modules except Client SDKs (Catchers). It is used for developmnet purposes but also can be used to self-host Hawk.
Documentation
- How to use hawk.mono to run local Hawk
- How to send testing events to the local hawk
- How to view Registry queues
How to run
- Run
git submodule init && git submodule update. - Create
.envfile in those repositories where there is.env.samplefile. - Run
docker-compose upto run all hawk services or list only the necessary services in the command above.
Logging (Loki + Grafana)
Grafana runs in Docker Compose and ships with a provisioned Logs dashboard that opens by default.
Local Loki (default)
- Copy
.env.sampleto.env(or update your existing.env) and keep the local values:
LOKI_ENDPOINT=http://loki:3100/loki/api/v1/push
LOKI_AUTH_HEADER=
GRAFANA_CLOUD_LOKI_USER=
GRAFANA_CLOUD_LOKI_API_KEY=
- Start services:
docker-compose up - Open Grafana:
http://localhost:3001
User:adminPassword:admin
Grafana Cloud Loki
- In
.env, comment the localLOKI_ENDPOINTand set the cloud values:
# LOKI_ENDPOINT=http://loki:3100/loki/api/v1/push
LOKI_ENDPOINT=https://<your-cloud-host>/loki/api/v1/push
GRAFANA_CLOUD_LOKI_USER=<your_cloud_loki_user_id>
GRAFANA_CLOUD_LOKI_API_KEY=<your_api_key>
- Start services:
docker-compose up - Open Grafana:
http://localhost:3001
User:adminPassword:admin
Troubleshooting
If something went wrong, check this items.
/api dir is empty after using ./pull-all-submodules.sh
git submodule update --remote --merge
docker-compose up failed
There can be a problems if docker has an outdated image or volume. You can try rebuild it.
Removing and image
Try this commands:
docker-compose build --no-cache <service>
service are garage or api etc (see docker-compose.yml -> services)
If it does not help, remove docker image and build again:
- List all images:
docker ps | grep hawk-
Copy image name
-
Remove an image
docker image rm <name>
- Rebuild
docker-compose up <service>
Removing a volume
- List all volumes:
docker volume ls
-
Find a volume you want to remove. For example,
hawkmono_api-deps -
Remove volume
docker volume rm hawkmono_api-deps
- Build
docker-compose build api
Executing Powershell scripts on Windows
To use Powershell scripts, you need to change the script execution policy in the system. Execute next command in Powershell terminal as administrator:
Set-ExecutionPolicy RemoteSignedPull all submodules
Run pull-all-submodules.ps1 script:
.\pull-all-submodules.ps1
Restore mongo data
Add your dump to dump\ folder and run mongorestore.ps1 script with collection name as parameter:
# Restore accounts data: .\mongorestore.ps1 accounts # Restore events data: .\mongorestore.ps1 events
