Skip to content

Commit 51da35e

Browse files
Merge branch 'main' into hotfix-hapi-fhir-tag-fixing
2 parents 7688185 + 8f6b5ca commit 51da35e

File tree

6 files changed

+1780
-19
lines changed

6 files changed

+1780
-19
lines changed

documentation/packages/monitoring/README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ description: A package for monitoring the platform services
44

55
# Monitoring
66

7-
The monitoring package sets up services to monitor the entire deployed stack. This includes the state of the servers involved in the docker swarm, the docker containers themselves and particular applications such as Kafka.
7+
The monitoring package sets up services to monitor the entire deployed stack. This includes the state of the servers involved in the docker swarm, the docker containers themselves and particular applications such as Kafka. It also captures the logs from the various services.
88

99
This monitoring package uses: 
1010

1111
* Grafana: for dashboards
1212
* Prometheus: for recording metrics
1313
* Cadvisor: for reading docker container metrics 
14-
* Kafka: for saving a backup of metrics data
14+
* Loki: for storing logs
15+
* Node Exporter: for monitoring host machine metrics like CPU, memory etc
1516

1617
To use the monitoring services, include the `monitoring` package id to your list of package ids when standing up the platform.
1718

@@ -31,7 +32,20 @@ To use custom metrics for an application, first configure that application to pr
3132
<strong> - prometheus-job-service=kafka
3233
</strong><strong> - prometheus-address=kafka-minion:8080</strong></code></pre>
3334

34-
`prometheus-job` lets Prometheus know to enable monitoring for this container and `prometheus-address` give the endpoint that the monitoring can access the metrics on. By default this is assumed to be at the path `/metrics` by Prometheus.
35+
`prometheus-job-service` lets Prometheus know to enable monitoring for this container and `prometheus-address` gives the endpoint that Prometheus can access the metrics on. By default this is assumed to be at the path `/metrics` by Prometheus.
36+
37+
By using the `prometheus-job-service` label prometheus will only create a single target for your application even if it is replicated via service config in docker swarm. If you would like to monitor each replica separately (i.e. if metrics are only captured for that replica and not shared to some central location in the application cluster) you can instead used the `prometheus-job-task` label and Prometheus will create a target for each replica.
38+
39+
A full list od supported labels are listed below:
40+
41+
* `prometheus-job-service` - indicates this service should be monitored
42+
* `prometheus-job-task` - indicates each task in the replicated service should be monitored separately
43+
* `prometheus-address` - the service address Prometheus can scrape metrics from, can only be used with `prometheus-job-service`
44+
* `prometheus-scheme` - the scheme to use when scaping a task or service (e.g. http or https), defaults to http
45+
* `prometheus-metrics-path` - the path to the metrics endpoint on the target (defaults to /metrics)
46+
* `prometheus-port` - the port of the metrics endpoint. Only usable with `prometheus-job-task`, defaults to all exposed ports for the container if no label is present
47+
48+
All services must also be on the `prometheus_public` network to be able to be seen by Prometheus for metrics scraping.
3549

3650
## Adding additional dashboards
3751

interoperability-layer-openhim/docker-compose.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ version: '3.9'
22

33
services:
44
openhim-core:
5-
image: jembi/openhim-core:v8.0.1
5+
image: jembi/openhim-core:v8.1.1
66
networks:
77
kafka:
88
hapi-fhir:
99
reverse-proxy:
1010
keycloak:
1111
public:
1212
default:
13+
prometheus:
1314
environment:
1415
- mongo_url=${OPENHIM_MONGO_URL}
1516
- mongo_atnaUrl=${OPENHIM_MONGO_ATNAURL}
@@ -31,6 +32,10 @@ services:
3132
reservations:
3233
cpus: ${OPENHIM_CPU_RESERVE}
3334
memory: ${OPENHIM_MEMORY_RESERVE}
35+
labels:
36+
- prometheus-job-task=openhim
37+
- prometheus-scheme=https
38+
- prometheus-port=8080
3439

3540
openhim-console:
3641
image: jembi/openhim-console:v1.18.2
@@ -74,4 +79,7 @@ networks:
7479
public:
7580
name: openhim_public
7681
external: true
82+
prometheus:
83+
name: prometheus_public
84+
external: true
7785
default:

monitoring/docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ services:
5050
source: kminion-groups_rev1.json
5151
- target: /etc/grafana/provisioning/dashboards/applications/kminion-topic_rev1.json
5252
source: kminion-topic_rev1.json
53+
- target: /etc/grafana/provisioning/dashboards/applications/openhim_nodejs_dashboard.json
54+
source: openhim_nodejs_dashboard.json
55+
- target: /etc/grafana/provisioning/dashboards/applications/openhim_transactions_dashboard.json
56+
source: openhim_transactions_dashboard.json
5357
- target: /etc/grafana/provisioning/dashboards/containers/logging-universal-dashboard_rev1.json
5458
source: logging-universal-dashboard_rev1.json
5559
networks:
@@ -195,6 +199,16 @@ configs:
195199
name: kminion-topic_rev1.json-${kminion_topic_rev1_json_DIGEST:?err}
196200
labels:
197201
name: grafana
202+
openhim_nodejs_dashboard.json:
203+
file: ./grafana/dashboards/applications/openhim_nodejs_dashboard.json
204+
name: openhim_nodejs_dashboard.json-${openhim_nodejs_dashboard_json_DIGEST:?err}
205+
labels:
206+
name: grafana
207+
openhim_transactions_dashboard.json:
208+
file: ./grafana/dashboards/applications/openhim_transactions_dashboard.json
209+
name: openhim_transactions_dashboard.json-${openhim_transactions_dashboard_json_DIGEST:?err}
210+
labels:
211+
name: grafana
198212
logging-universal-dashboard_rev1.json:
199213
file: ./grafana/dashboards/containers/logging-universal-dashboard_rev1.json
200214
name: logging-universal-dashboard_rev1.json-${logging_universal_dashboard_rev1_json_DIGEST:?err}

0 commit comments

Comments
 (0)