Skip to content

Commit cd14b5c

Browse files
committed
reorg into folders, add hotROD dashboard, add basic description to README
1 parent f67b518 commit cd14b5c

File tree

6 files changed

+2336
-17
lines changed

6 files changed

+2336
-17
lines changed
+50-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
# Hot R.O.D. - Rides on Demand - Grafana integration
22

3-
This is the Hot R.O.D. demo application that consists of the same components as the `examples/hotrod/`, only Grafana and Loki integration is added to this setup, so you can correlate logs and traces in one application.
3+
This is the Hot R.O.D. demo application that consists of the same components as the `examples/hotrod/`, only Grafana, Loki and Prometheus integration is added to this setup, so you can correlate logs, metrics and traces in one application.
44

5-
## Running
5+
## Running via `docker-compose`
66

7-
### Run everything via `docker-compose`
7+
### Prerequisites
8+
9+
* Clone the Jaeger repository `git clone https://github.com/jaegertracing/jaeger.git`, then `cd examples/grafana-integration`
10+
11+
* All services will log to Loki via the loki docker logging plugin.
12+
To install run this on the host:
13+
14+
```bash
15+
docker plugin install \
16+
grafana/loki-docker-driver:latest \
17+
--alias loki \
18+
--grant-all-permissions
19+
```
20+
21+
### Deploy the services
22+
23+
* Pull up the services: `docker-compose up`
824

9-
#### Prerequisites
10-
* Download `docker-compose.yml` from https://github.com/jaegertracing/jaeger/blob/master/examples/grafana-integration/docker-compose.yml
11-
* Download the `datasources.yaml` from the `examples/grafana-integration/` folder
1225
* All services will log to Loki via the loki docker logging plugin.
1326
To install run this on the host once:
1427

@@ -19,8 +32,35 @@ grafana/loki-docker-driver:latest \
1932
--grant-all-permissions
2033
```
2134

22-
#### Deploy the local setup
23-
* Run Grafana and Loki integration with Jaeger backend using HotROD demo with `docker-compose -f path-to-yml-file up`
24-
* Access Grafana UI at http://localhost:3000 and HotROD app at http://localhost:8080
25-
* Shutdown / cleanup with `docker-compose -f path-to-yml-file down`
35+
### Access the services
36+
* HotROD application at http://localhost:8080
37+
* Access Grafana UI at http://localhost:3000
38+
39+
### Explore with Loki
40+
41+
Currently the most powerful way to correlate application logs with traces can be performed via Grafana's Explore interface.
42+
43+
After setting the datasource to Loki, all the log labels become available, and can be easily filtered using [Loki's LogQL query language](https://grafana.com/docs/loki/latest/logql/).
44+
45+
For example after selecting the compose project, errors can be filtered with the following expression:
46+
47+
```
48+
{compose-project="grafana-integration"} |= "error"
49+
```
50+
51+
which will list the redis timeout events.
52+
53+
### HotROD - Metrics and logs overview dashboard
54+
55+
Since the HotROD application can expose its metrics in Prometheus' format, these can be also used during investigation.
56+
57+
This example includes a dashboard, which contains a log panel, which displays the logs for the selected services in real time. These can be also filtered by a search field.
58+
59+
There are also panels to display the ratio/percentage of errors in the current timeframe.
60+
61+
Additionally, there are graphs for each service, visualing the rate of the requests and showing latency percentiles.
62+
63+
### Clean up
64+
65+
To stop the containers use `docker-compose -f path-to-yml-file down`
2666

examples/grafana-integration/docker-compose.yaml

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
version: '2'
2+
23
services:
34
grafana:
45
image: grafana/grafana:7.1.4
56
ports:
67
- '3000:3000'
78
volumes:
8-
- ./datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
9+
- ./grafana/provisioning/:/etc/grafana/provisioning/
910
logging:
1011
driver: loki
1112
options:
@@ -16,6 +17,7 @@ services:
1617
ports:
1718
- '3100:3100'
1819
command: -config.file=/etc/loki/local-config.yaml
20+
# send Loki traces to Jaeger
1921
environment:
2022
- JAEGER_AGENT_HOST=jaeger
2123
- JAEGER_AGENT_PORT=6831
@@ -39,9 +41,9 @@ services:
3941
hotrod:
4042
image: jaegertracing/example-hotrod:latest
4143
ports:
42-
- "8080:8080"
43-
- "8083:8083"
44-
command: ["-m", "prometheus","all"]
44+
- '8080:8080'
45+
- '8083:8083'
46+
command: ["-m","prometheus","all"]
4547
environment:
4648
- JAEGER_AGENT_HOST=jaeger
4749
- JAEGER_AGENT_PORT=6831
@@ -51,11 +53,11 @@ services:
5153
loki-url: 'http://localhost:3100/api/prom/push'
5254

5355
prometheus:
54-
image: prom/prometheus:v2.19.0
56+
image: prom/prometheus:v2.19.1
5557
volumes:
56-
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
58+
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
5759
ports:
58-
- 9090:9090
60+
- '9090:9090'
5961
command:
6062
- --config.file=/etc/prometheus/prometheus.yml
6163
logging:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: 1
2+
3+
providers:
4+
- name: 'HotROD'
5+
orgId: 1
6+
folder: ''
7+
type: file
8+
disableDeletion: false
9+
editable: true
10+
options:
11+
path: /etc/grafana/provisioning/dashboards

0 commit comments

Comments
 (0)