Skip to content

Commit fcf09b6

Browse files
committed
Provision Graphana Dashboards, Update Readme for TICK monitoring setup.
1 parent e999060 commit fcf09b6

File tree

7 files changed

+14350
-43
lines changed

7 files changed

+14350
-43
lines changed

Diff for: README.md

+49-9
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Services will be exposed in this ports
5151
```
5252
Api Gateway Service : 8765
5353
Eureka Discovery Service : 8761
54+
Consul Discovery : 8500
5455
Account Service : 4001
5556
Billing Service : 5001
5657
Catalog Service : 6001
@@ -59,6 +60,17 @@ Order Service : 7001
5960

6061
<hr>
6162

63+
### Service Discovery
64+
This project uses Eureka or Consul as Discovery service.
65+
66+
While running services in local, then using eureka as service discovery.
67+
68+
While running using docker, then consul is the service discovery.
69+
70+
Reason to use Consul is it has better features and support compared to Eureka. Running services individually in local uses Eureka as service discovery because dont want to run consul agent and set it up as it becomes extra overhead to manage. Since docker-compose manages all consul stuff hence using Consul while running services in docker.
71+
72+
<hr>
73+
6274
### Troubleshooting
6375

6476
If any issue while starting up services or any api failing.
@@ -88,28 +100,39 @@ Below is the AWS Architecture diagram for better understanding.
88100
<hr>
89101

90102
## Monitoring
91-
Using Docker images of Prometheus, Graphana and Zipkin for monitoring microservices,
92-
using docker images makes setting up graphana, zipkin, prometheus very easy. Just run docker images of those and
93-
send or pull metrics from monitoring containers.
103+
There are 2 setups for monitoring
94104

95-
`docker-compose` will take care of bringing all this monitoring containers up.
105+
1. Prometheus and Graphana.
106+
2. TICK stack monitoring.
107+
108+
Both the setups are very powerful, where prometheus works on pull model. we have to provide target hosts where the prometheus can pull the metrics from. If we specify target hosts using individual hostname/ip its not feasible at end because it will be like hard coded hostnames/ip. So we use Consul discovery to provide target hosts dynamically. By this way when more instances added for same service no need to worry about adding to prometheus target hosts because consul will dynamically add this target in prometheus.
96109

97-
More details at this link : https://www.callicoder.com/spring-boot-actuator-metrics-monitoring-dashboard-prometheus-grafana/
110+
TICK(Telegraf, InfluxDB, Chronograf, Kapacitor) This setup is getting more attention due to its push and pull model. InfluxDB is a time series database, bookstore services push the metrics to influxDB(push model), In Telegraf we specify the targets to pull metrics(pull model). Chronograf/Graphana can be used to view the graph/charts. Kapacitor is used to configure rules for alarms.
111+
112+
`docker-compose` will take care of bringing all this monitoring containers up.
98113

99114
Dashboards are available at below ports
100115

101116
```
102117
Graphana : 3030
103118
Zipkin : 9411
104119
Prometheus : 9090
120+
Telegraf : 8125
121+
InfluxDb : 8086
122+
Chronograf : 8888
123+
Kapacitor : 9092
124+
105125
```
106126

107-
**Screenshots of Monitoring in Graphana.**
127+
```
128+
First time login to Graphana use below credentials
108129
109-
<img alt="API Gateway Metrics" src="https://user-images.githubusercontent.com/14878408/65935653-7c39ae80-e437-11e9-884e-8e2e0dce5b8c.png">
110-
<hr>
111-
<img alt="API Gateway Metrics2" src="https://user-images.githubusercontent.com/14878408/65935715-bb67ff80-e437-11e9-8e22-ce94d64cfb87.png">
130+
Username : admin
131+
Password : admin
112132
133+
```
134+
135+
<hr>
113136

114137
**Screenshots of Tracing in Zipkin.**
115138

@@ -119,6 +142,23 @@ Prometheus : 9090
119142

120143
<hr>
121144

145+
**Screenshots of Monitoring in Graphana.**
146+
147+
<img width="1680" alt="Screen Shot 2019-10-16 at 9 16 21 PM" src="https://user-images.githubusercontent.com/14878408/66936473-65ac6d80-f05b-11e9-9e7d-9652059438cd.png">
148+
149+
150+
<img width="1680" alt="Screen Shot 2019-10-16 at 9 16 12 PM" src="https://user-images.githubusercontent.com/14878408/66936524-79f06a80-f05b-11e9-8898-1002813aad8e.png">
151+
152+
<hr>
153+
154+
**Screenshots of Monitoring in Chronograf(TICK).**
155+
156+
![Screen Shot 2019-10-16 at 12 44 20 PM](https://user-images.githubusercontent.com/14878408/66934353-f8e3a400-f057-11e9-82ab-eda7a230c09d.png)
157+
158+
![Screen Shot 2019-10-16 at 12 52 08 PM](https://user-images.githubusercontent.com/14878408/66934482-2e888d00-f058-11e9-8dea-f1f275765265.png)
159+
160+
<hr>
161+
122162
> Account Service
123163
124164
To Get `access_token` for the user, you need `clientId` and `clientSecret`

Diff for: bookstore-graphana/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ FROM grafana/grafana
33
# Add in the configuration file from the local directory.
44
ADD datasource.yml /etc/grafana/provisioning/datasources/datasource.yml
55
ADD dashboard.yml /etc/grafana/provisioning/dashboards/dashboard.yml
6-
ADD services-dashboard.json /var/lib/grafana/dashboards/services-dashboard.json
6+
ADD services-dashboard.json /var/lib/grafana/dashboards/services-dashboard.json
7+
ADD docker-container-dashboard.json /var/lib/grafana/dashboards/docker-container-dashboard.json
8+
ADD docker-all-dashboard.json /var/lib/grafana/dashboards/docker-all-dashboard.json

Diff for: bookstore-graphana/datasource.yml

+44
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,50 @@ datasources:
3636
jsonData:
3737
httpMode: GET
3838

39+
- name: InfluxDB Internal
40+
# <string, required> datasource type. Required
41+
type: influxdb
42+
# <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
43+
access: direct
44+
# <int> org id. will default to orgId 1 if not specified
45+
orgId: 1
46+
# <string> url
47+
url: http://localhost:8086
48+
# <string> Deprecated, use secureJsonData.password
49+
password:
50+
# <string> database user, if used
51+
user:
52+
# <string> database name, if used
53+
database: _internal
54+
# <string> json object of data that will be encrypted.
55+
version: 1
56+
# <bool> allow users to edit datasources from the UI.
57+
editable: true
58+
jsonData:
59+
httpMode: GET
60+
61+
- name: InfluxDB Telegraf
62+
# <string, required> datasource type. Required
63+
type: influxdb
64+
# <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
65+
access: direct
66+
# <int> org id. will default to orgId 1 if not specified
67+
orgId: 1
68+
# <string> url
69+
url: http://localhost:8086
70+
# <string> Deprecated, use secureJsonData.password
71+
password:
72+
# <string> database user, if used
73+
user:
74+
# <string> database name, if used
75+
database: telegraf
76+
# <string> json object of data that will be encrypted.
77+
version: 1
78+
# <bool> allow users to edit datasources from the UI.
79+
editable: true
80+
jsonData:
81+
httpMode: GET
82+
3983
- name: Prometheus
4084
# <string, required> datasource type. Required
4185
type: prometheus

0 commit comments

Comments
 (0)