|
| 1 | +/////////////////////////////////////////////////////////////////////////////// |
| 2 | + |
| 3 | + Copyright (c) 2025 Oracle and/or its affiliates. |
| 4 | + Licensed under the Universal Permissive License v 1.0 as shown at |
| 5 | + https://oss.oracle.com/licenses/upl. |
| 6 | + |
| 7 | +/////////////////////////////////////////////////////////////////////////////// |
| 8 | +
|
| 9 | += Local Monitoring |
| 10 | +:description: Coherence CLI - Local Monitoring |
| 11 | +:keywords: oracle coherence, coherence-cli, documentation, management, cli, monitoring, grafana, prometheus, metrics |
| 12 | +
|
| 13 | +== Local Monitoring |
| 14 | +
|
| 15 | +=== Overview |
| 16 | +There are various commands that allow you to initialize, start and stop a local monitoring stack using Grafana and Prometheus. This |
| 17 | +allows you gain insight into your local development clusters using the pre-built dashboards. |
| 18 | +
|
| 19 | +After using `cohctl monitoring init`, the directory `/Users/timbo/.cohctl/monitoring` contains a complete `docker compose` project. |
| 20 | +You can manually start/ stop using `docker compose` from that directory, or use the <<start-monitoring,`start monitoring`>> or <<stop-monitoring,`stop monitoring`>> convenience commands. Prometheus scrapes local metrics ports from 9612 -> 9169 for any Coherence clusters with metrics enabled. |
| 21 | +
|
| 22 | +After you start the monitoring you can start a local cluster using `cohctl start cluster my-cluster -t 9612` to enable metrics. |
| 23 | +
|
| 24 | +See the Coherence documentation to {commercial-docs-base-url}/manage/using-coherence-metrics.html[setup up Coherence metrics] on your own cluster. |
| 25 | +
|
| 26 | +NOTE: You must have a `docker` version installed and running on your machine that includes the updated `docker compose` command. |
| 27 | +
|
| 28 | +* <<init-monitoring, `cohctl init monitoring`>> - initialize local monitoring for Coherence |
| 29 | +* <<start-monitoring, `cohctl start monitoring`>> - starts the local monitoring stack |
| 30 | +* <<stop-monitoring, `cohctl stop monitoring`>> - stops the local monitoring stack |
| 31 | +* <<get-monitoring, `cohctl get monitoring`>> - gets the current monitoring stack status |
| 32 | +
|
| 33 | +
|
| 34 | +[#init-monitoring] |
| 35 | +==== Initialize Monitoring Stack |
| 36 | +
|
| 37 | +include::../../build/_output/docs-gen/init_monitoring.adoc[tag=text] |
| 38 | +
|
| 39 | +[source,bash] |
| 40 | +---- |
| 41 | +cohctl init monitoring |
| 42 | +---- |
| 43 | +
|
| 44 | +Output: |
| 45 | +[source,bash] |
| 46 | +---- |
| 47 | +This command will: |
| 48 | +1. Create a directory /Users/timbo/.cohctl/monitoring |
| 49 | +2. Download Grafana dashboards |
| 50 | +2. Download docker compose files |
| 51 | +3. Pull Grafana and Prometheus images |
| 52 | +
|
| 53 | +Are you sure you want to initialize monitoring? (y/n) y |
| 54 | +
|
| 55 | +Ensuring directories... |
| 56 | +Downloading Grafana dashboards... |
| 57 | + - cache-details-dashboard.json |
| 58 | + - cache-store-details-dashboard.json |
| 59 | + - caches-summary-dashboard.json |
| 60 | + - coherence-dashboard-main.json |
| 61 | + - elastic-data-summary-dashboard.json |
| 62 | + - executor-details.json |
| 63 | + - executors-summary.json |
| 64 | + - federation-details-dashboard.json |
| 65 | + - federation-summary-dashboard.json |
| 66 | + - grpc-proxy-details-dashboard.json |
| 67 | + - grpc-proxy-summary-dashboard.json |
| 68 | + - http-servers-summary-dashboard.json |
| 69 | + - machines-summary-dashboard.json |
| 70 | + - member-details-dashboard.json |
| 71 | + - members-summary-dashboard.json |
| 72 | + - persistence-summary-dashboard.json |
| 73 | + - proxy-server-detail-dashboard.json |
| 74 | + - proxy-servers-summary-dashboard.json |
| 75 | + - service-details-dashboard.json |
| 76 | + - services-summary-dashboard.json |
| 77 | + - topic-details-dashboard.json |
| 78 | + - topic-subscriber-details.json |
| 79 | + - topic-subscriber-group-details.json |
| 80 | + - topics-summary-dashboard.json |
| 81 | +Downloading docker compose files... |
| 82 | + - grafana.ini |
| 83 | + - dashboards.yaml |
| 84 | + - datasources.yaml |
| 85 | + - docker-compose.yaml |
| 86 | + - prometheus.yaml |
| 87 | +Pulling docker images... |
| 88 | +Issuing docker pull prom/prometheus:v2.53.4 |
| 89 | +v2.53.4: Pulling from prom/prometheus |
| 90 | +Digest: sha256:502ad90314c7485892ce696cb14a99fceab9fc27af29f4b427f41bd39701a199 |
| 91 | +Status: Image is up to date for prom/prometheus:v2.53.4 |
| 92 | +docker.io/prom/prometheus:v2.53.4 |
| 93 | +Issuing docker pull grafana/grafana:11.6.2 |
| 94 | +11.6.2: Pulling from grafana/grafana |
| 95 | +Digest: sha256:a3464c5dadc2e16aaeb813aead8c852e81cc7bbfa851c66d96f016d5257b9848 |
| 96 | +Status: Image is up to date for grafana/grafana:11.6.2 |
| 97 | +docker.io/grafana/grafana:11.6.2 |
| 98 | +operation completed |
| 99 | +
|
| 100 | +Note: You can change the grafana and prometheus image versions by editing: |
| 101 | + /Users/timbo/.cohctl/monitoring/docker-compose.yaml |
| 102 | +---- |
| 103 | +
|
| 104 | +NOTE: The directory `/Users/timbo/.cohctl/monitoring` contains a complete `docker compose` project. |
| 105 | +You can manually start/ stop using `docker compose` from that directory, or use the `start monitoring` or `stop monitoring` convenience commands. |
| 106 | +You can also update the Grafana and Prometheus image versions in the `docker-compse.yaml` file in this directory. |
| 107 | +
|
| 108 | +
|
| 109 | +[#start-monitoring] |
| 110 | +==== Start Monitoring Stack |
| 111 | +
|
| 112 | +include::../../build/_output/docs-gen/start_monitoring.adoc[tag=text] |
| 113 | +
|
| 114 | +[source,bash] |
| 115 | +---- |
| 116 | +cohctl start monitoring |
| 117 | +---- |
| 118 | +
|
| 119 | +Output: |
| 120 | +[source,bash] |
| 121 | +---- |
| 122 | +Issuing docker compose -f /Users/timbo/.cohctl/monitoring/docker-compose.yaml up -d |
| 123 | + Network monitoring_coherence Creating |
| 124 | + Network monitoring_coherence Created |
| 125 | + Container monitoring-prometheus-1 Creating |
| 126 | + Container monitoring-grafana-1 Creating |
| 127 | + Container monitoring-grafana-1 Created |
| 128 | + Container monitoring-prometheus-1 Created |
| 129 | + Container monitoring-grafana-1 Starting |
| 130 | + Container monitoring-prometheus-1 Starting |
| 131 | + Container monitoring-prometheus-1 Started |
| 132 | + Container monitoring-grafana-1 Started |
| 133 | +
|
| 134 | +Open the Grafana dashboard at http://localhost:3000/d/coh-main/coherence-dashboard-main, using admin/admin |
| 135 | +
|
| 136 | +Issuing docker ps |
| 137 | +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 138 | +03d14608f5e2 prom/prometheus:v2.53.4 "/bin/prometheus --c…" Less than a second ago Up Less than a second 0.0.0.0:9090->9090/tcp monitoring-prometheus-1 |
| 139 | +5dc519fd544b grafana/grafana:11.6.2 "/run.sh" Less than a second ago Up Less than a second 0.0.0.0:3000->3000/tcp monitoring-grafana-1 |
| 140 | +---- |
| 141 | +
|
| 142 | +Wait for around 30 seconds, before accessing the Grafana dashboard at http://localhost:3000/d/coh-main/coherence-dashboard-main using the username/password mentioned above. |
| 143 | +
|
| 144 | +NOTE: This is local only setup for monitoring your development clusters, is not meant for production use. |
| 145 | +
|
| 146 | +[#stop-monitoring] |
| 147 | +==== Stop Monitoring Stack |
| 148 | +
|
| 149 | +include::../../build/_output/docs-gen/stop_monitoring.adoc[tag=text] |
| 150 | +
|
| 151 | +[source,bash] |
| 152 | +---- |
| 153 | +cohctl stop monitoring |
| 154 | +---- |
| 155 | +
|
| 156 | +Output: |
| 157 | +[source,bash] |
| 158 | +---- |
| 159 | +Are you sure you want to stop monitoring? (y/n) y |
| 160 | +Issuing docker compose -f /Users/timbo/.cohctl/monitoring/docker-compose.yaml down |
| 161 | + Container monitoring-grafana-1 Stopping |
| 162 | + Container monitoring-prometheus-1 Stopping |
| 163 | + Container monitoring-prometheus-1 Stopped |
| 164 | + Container monitoring-prometheus-1 Removing |
| 165 | + Container monitoring-prometheus-1 Removed |
| 166 | + Container monitoring-grafana-1 Stopped |
| 167 | + Container monitoring-grafana-1 Removing |
| 168 | + Container monitoring-grafana-1 Removed |
| 169 | + Network monitoring_coherence Removing |
| 170 | + Network monitoring_coherence Removed |
| 171 | +Issuing docker ps |
| 172 | +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 173 | +---- |
| 174 | +
|
| 175 | +[#get-monitoring] |
| 176 | +==== Get Monitoring Stack Status |
| 177 | +
|
| 178 | +include::../../build/_output/docs-gen/get_monitoring.adoc[tag=text] |
| 179 | +
|
| 180 | +[source,bash] |
| 181 | +---- |
| 182 | +cohctl get monitoring |
| 183 | +---- |
| 184 | +
|
| 185 | +Output: |
| 186 | +[source,bash] |
| 187 | +---- |
| 188 | +Monitoring status |
| 189 | +Grafana: http://localhost:3000/d/coh-main/coherence-dashboard-main |
| 190 | + Image: grafana/grafana:11.6.2 |
| 191 | + Status: ok, version=11.6.2 |
| 192 | +Prometheus: http://localhost:9090/ |
| 193 | + Image: prom/prometheus:v2.53.4 |
| 194 | + Status: Prometheus Server is Healthy. |
| 195 | +
|
| 196 | +Compose: /Users/timbo/.cohctl/monitoring/docker-compose.yaml |
| 197 | +Docker |
| 198 | +Issuing docker ps |
| 199 | +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 200 | +ac74f5b13702 prom/prometheus:v2.53.4 "/bin/prometheus --c…" About a minute ago Up About a minute 0.0.0.0:9090->9090/tcp monitoring-prometheus-1 |
| 201 | +6c550a1f58d1 grafana/grafana:11.6.2 "/run.sh" About a minute ago Up About a minute 0.0.0.0:3000->3000/tcp monitoring-grafana-1 |
| 202 | +---- |
| 203 | +
|
| 204 | +=== See Also |
| 205 | +
|
| 206 | +* {commercial-docs-base-url}/manage/using-coherence-metrics.html[Setting up Coherence Metrics] |
| 207 | +* xref:create_clusters.adoc[Creating Development Clusters] |
| 208 | +
|
| 209 | +
|
| 210 | +
|
0 commit comments