Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit Crickboom committed Oct 4, 2023
1 parent 7848890 commit 597d8b2
Show file tree
Hide file tree
Showing 9 changed files with 7,457 additions and 2 deletions.
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
# orthanc-monitoring
First trial for monitoring
# Orthanc-monitoring

## Summary
Here is only a basic Orthanc with a Postgres.

But these 2 services, as well as the host system and the containers, are monitored thanks to Prometheus.
Grafana is also there to show the metrics.

## How it works

### Prometheus

Prometheus will collect the metrics from these sources:
- Orthanc ([link to official doc](https://book.orthanc-server.com/users/advanced-rest.html#instrumentation-with-prometheus))
- Node-exporter (allow to get the metrics from the system: CPU, RAM, disk space,...)
- Postgres (thanks to the exporter)
- CAdvisor (allow to get the metrics from the containers)

### Grafana

There is a predefined dashboard with all the metrics listed above.

## Misc
- There is a volume for the dashboard (Grafana container) so, if an update (with a new version of the dashboard) has to be made, the volume has to be deleted (otherwise, the dashboard will remain as it was)
114 changes: 114 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
version: "3.8"

services:

orthanc:
image: osimis/orthanc:23.3.0
restart: unless-stopped
depends_on:
- postgres
ports:
- 8042:8042
environment:
ORTHANC__NAME: "Orthanc PACS"
VERBOSE_ENABLED: "true"
VERBOSE_STARTUP: "true"
STONE_WEB_VIEWER_PLUGIN_ENABLED: "true"
ORTHANC__STONE_WEB_VIEWER__SHOW_INFO_PANEL_AT_STARTUP: "Never"
ORTHANC__ORTHANC_EXPLORER_2__UI_OPTIONS__STUDY_LIST_SEARCH_MODE: "search-button"
ORTHANC__ORTHANC_EXPLORER_2__UI_OPTIONS__STUDY_LIST_EMPTY_IF_NO_SEARCH: "true"
ORTHANC__ORTHANC_EXPLORER_2__IS_DEFAULT_ORTHANC_UI: "true"
ORTHANC__POSTGRESQL__HOST: "postgres"
ORTHANC__POSTGRESQL__ENABLE_INDEX: "true"
ORTHANC__POSTGRESQL__ENABLE_STORAGE: "false"
DICOM_WEB_PLUGIN_ENABLED: "true"
ORTHANC__AUTHENTICATION_ENABLED: "false"
volumes: ["orthanc-data:/var/lib/orthanc/db:Z"]

postgres:
image: postgres:15
restart: unless-stopped
volumes: ["orthanc-index:/var/lib/postgresql/data:Z"]
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"

prometheus:
build: prometheus
ports:
- 9090:9090
volumes:
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
restart: unless-stopped
depends_on:
- node-exporter

node-exporter:
image: prom/node-exporter:v1.5.0
ports:
- 9100:9100
# volumes:
# - /proc:/host/proc:ro
# - /sys:/host/sys:ro
# - /:/rootfs:ro
# command:
# - '--path.procfs=/host/proc'
# - '--path.sysfs=/host/sys'
# - '--collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+)($$|/)'
command:
- '--path.rootfs=/host'
# - '--cap-add=SYS_TIME'
volumes:
- '/:/host:ro,rslave'
# - /proc:/host/proc:ro
# - /sys:/host/sys:ro
# - /:/rootfs:ro
restart: unless-stopped

cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.47.1
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
privileged: true
restart: unless-stopped

postgres-exporter:
image: quay.io/prometheuscommunity/postgres-exporter:v0.12.0
restart: unless-stopped
depends_on:
- postgres
environment:
- DATA_SOURCE_NAME=postgresql://postgres@postgres:5432/postgres?sslmode=disable

grafana:
build: grafana
ports:
- 3000:3000
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
- DS_PROMETHEUS=prometheus
depends_on:
- prometheus
restart: unless-stopped
volumes:
- "dashboards:/var/lib/grafana:Z"
- "grafana-config:/etc/grafana:Z"
- "grafana-logs:/var/log/grafana:Z"



volumes:
prometheus_data:
orthanc-data:
orthanc-index:
dashboards:
grafana-config:
grafana-logs:

7 changes: 7 additions & 0 deletions grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM grafana/grafana:8.2.6

COPY datasource.yml /etc/grafana/provisioning/datasources

COPY dashboard.json /etc/grafana/provisioning/dashboards
COPY dashboard.yml /etc/grafana/provisioning/dashboards

Loading

0 comments on commit 597d8b2

Please sign in to comment.