Skip to content

Commit

Permalink
Fix example/grafana-integration (#4980)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?

Currently, the `grafana-integration` example doesn't work properly: if
you run `docker-compose up` in that folder, services will start but only
logging will work, the metrics and tracing won't.

## Description of the changes

* Fix traces endpoint config for hotrod (`traces export: Post
"http://localhost:4318/v1/traces": dial tcp 127.0.0.1:4318: connect:
connection refused`)
* Fix hotrod metrics scraping (endpoint has moved to the frontend
service)
* Pin Jaeger/hotrod tags to prevent future issues
* Fix Grafana dashboard (metric names, labels, migrate to new time
series panel)
* Add default Grafana credentials to README
* Fix the loki container being stuck on shutdown by setting shorter
timeouts (bug with the driver:
grafana/loki#2361 (comment))
* Update Grafana/Loki/Prom pinned versions (especially to get Grafana UI
improvements)

## How was this change tested?

`docker-compose up` 🙂 

<img width="2304" alt="SCR-20231201-cohy"
src="https://github.com/jaegertracing/jaeger/assets/11699655/22016bd9-0f99-40c7-be18-eb733561572a">
<img width="2304" alt="SCR-20231201-cxos"
src="https://github.com/jaegertracing/jaeger/assets/11699655/db761bc3-53ac-41fa-914d-803c73233ad7">
<img width="2304" alt="SCR-20231201-coke"
src="https://github.com/jaegertracing/jaeger/assets/11699655/004c99f0-0d1f-46f1-a9da-f50f0148d377">

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [ ] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: Stanislas Lange <git@slange.me>
  • Loading branch information
angristan authored Dec 1, 2023
1 parent 02dc655 commit e170dba
Show file tree
Hide file tree
Showing 4 changed files with 481 additions and 1,922 deletions.
4 changes: 2 additions & 2 deletions examples/grafana-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ grafana/loki-docker-driver:latest \

### Run the services

`docker-compose up`
`docker-compose up`

### Access the services
* HotROD application at http://localhost:8080
* Grafana UI at http://localhost:3000
* Grafana UI at http://localhost:3000 (default credentials: admin/admin)

### Explore with Loki

Expand Down
20 changes: 12 additions & 8 deletions examples/grafana-integration/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '2'

services:
grafana:
image: grafana/grafana:7.1.4
image: grafana/grafana:10.2.2
ports:
- '3000:3000'
volumes:
Expand All @@ -15,7 +15,7 @@ services:
loki-url: 'http://localhost:3100/api/prom/push'

loki:
image: grafana/loki:master
image: grafana/loki:2.9.2
ports:
- '3100:3100'
command: -config.file=/etc/loki/local-config.yaml
Expand All @@ -29,9 +29,14 @@ services:
driver: loki
options:
loki-url: 'http://localhost:3100/api/prom/push'
# Prevent container from being stuck when shutting down
# https://github.com/grafana/loki/issues/2361#issuecomment-718024318
loki-timeout: 1s
loki-max-backoff: 1s
loki-retries: 1

jaeger:
image: jaegertracing/all-in-one:latest
image: jaegertracing/all-in-one:1.51
ports:
- '6831:6831'
- '16686:16686'
Expand All @@ -41,27 +46,26 @@ services:
loki-url: 'http://localhost:3100/api/prom/push'

hotrod:
image: jaegertracing/example-hotrod:latest
image: jaegertracing/example-hotrod:1.51
ports:
- '8080:8080'
- '8083:8083'
command: ["-m","prometheus","all"]
environment:
- JAEGER_AGENT_HOST=jaeger
- JAEGER_AGENT_PORT=6831
- OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4318
logging:
driver: loki
options:
loki-url: 'http://localhost:3100/api/prom/push'

prometheus:
image: prom/prometheus:v2.19.1
image: prom/prometheus:v2.48.0
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
ports:
- '9090:9090'
command:
- --config.file=/etc/prometheus/prometheus.yml
- --config.file=/etc/prometheus/prometheus.yml
logging:
driver: loki
options:
Expand Down
Loading

0 comments on commit e170dba

Please sign in to comment.