Skip to content

issue #48 - examples on monitoring the application #49

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ services:
tty: true
container_name: bpc_admin_site_django
privileged: true
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9999"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
cron-service:
build:
context: .
Expand Down
30 changes: 30 additions & 0 deletions monitoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Monitoring OS2BorgerPC admin-site

There are various ways of monitoring the application, some are:
1) health check
2) viewing logs
3) viewing resource usage

Below are examples on how this can be done for the provided docker-compose testing setup that can be used as inspiration.

## Health check
This section in the compose.yaml shows how to implement a health check for a docker-compose setup.
```
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9999"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
```

## Viewing logs
```
docker logs bpc_admin_site_django
```

## Viewing resource usage
```
docker stats bpc_admin_site_django
```