Skip to content

Commit 33bc30c

Browse files
committed
rework folder structure, remove duplicated file, accept suggestions
Signed-off-by: fktkrt <fktkrt@gmail.com>
1 parent 91900d6 commit 33bc30c

File tree

6 files changed

+12
-29
lines changed

6 files changed

+12
-29
lines changed
+9-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
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, Loki and Prometheus integration is added to this setup, so you can correlate logs, metrics and traces in one application.
3+
This example combines the Hot R.O.D. demo application ([examples/hotrod/](../hotrod/)) with Grafana, Loki and Prometheus integration, to demonstrate logs, metrics and traces correlation.
44

55
## Running via `docker-compose`
66

77
### Prerequisites
88

99
* Clone the Jaeger repository `git clone https://github.com/jaegertracing/jaeger.git`, then `cd examples/grafana-integration`
1010

11-
* All services will log to Loki via the loki docker logging plugin.
12-
To install run this on the host:
11+
* All services will log to Loki via the [official Docker driver plugin](https://grafana.com/docs/loki/latest/clients/docker-driver/).
12+
Install the Loki logging plugin for Docker:
1313

1414
```bash
1515
docker plugin install \
@@ -18,21 +18,21 @@ grafana/loki-docker-driver:latest \
1818
--grant-all-permissions
1919
```
2020

21-
### Deploy the services
21+
### Run the services
2222

23-
Pull up the services: `docker-compose up`
23+
`docker-compose up`
2424

2525
### Access the services
2626
* HotROD application at http://localhost:8080
27-
* Access Grafana UI at http://localhost:3000
27+
* Grafana UI at http://localhost:3000
2828

2929
### Explore with Loki
3030

3131
Currently the most powerful way to correlate application logs with traces can be performed via Grafana's Explore interface.
3232

3333
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/).
3434

35-
For example after selecting the compose project, errors can be filtered with the following expression:
35+
For example, after selecting the compose project/service under Log labels , errors can be filtered with the following expression:
3636

3737
```
3838
{compose-project="grafana-integration"} |= "error"
@@ -44,13 +44,12 @@ which will list the redis timeout events.
4444

4545
Since the HotROD application can expose its metrics in Prometheus' format, these can be also used during investigation.
4646

47-
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.
47+
This example includes a dashboard that contains a log panel for the selected services in real time. These can be also filtered by a search field, that provides `grep`-like features.
4848

4949
There are also panels to display the ratio/percentage of errors in the current timeframe.
5050

5151
Additionally, there are graphs for each service, visualing the rate of the requests and showing latency percentiles.
5252

5353
### Clean up
5454

55-
To stop the containers use `docker-compose -f path-to-yml-file down`
56-
55+
`docker-compose down`

examples/grafana-integration/datasources.yaml

-18
This file was deleted.

examples/grafana-integration/docker-compose.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ services:
66
ports:
77
- '3000:3000'
88
volumes:
9-
- ./grafana/provisioning/:/etc/grafana/provisioning/
9+
- ./grafana/datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
10+
- ./grafana/dashboards.yml:/etc/grafana/provisioning/dashboards/dashboards.yml
11+
- ./grafana/hotrod_metrics_logs.json:/etc/grafana/provisioning/dashboards/hotrod_metrics_logs.json
1012
logging:
1113
driver: loki
1214
options:

0 commit comments

Comments
 (0)