blueswen / spring-boot-observability

Observe Spring Boot app with three pillars of observability: Traces (Tempo), Metrics (Prometheus), Logs (Loki) on Grafana through OpenTelemetry and OpenMetrics.
252 stars 82 forks source link

Can't run the demo in the docker-compose env #7

Open peter-hst opened 6 months ago

peter-hst commented 6 months ago

Hello, Would you help me take a look? thanks!

I have clone your code on main branch,and then I cannot run the demo, there is something came up.

# docker-compose ps
                 Name                               Command               State                         Ports
-----------------------------------------------------------------------------------------------------------------------------------
spring-boot-observability_app-a_1        java -javaagent:/opentelem ...   Up       0.0.0.0:8080->8080/tcp
spring-boot-observability_app-b_1        java -javaagent:/opentelem ...   Up       0.0.0.0:8081->8080/tcp
spring-boot-observability_app-c_1        java -javaagent:/opentelem ...   Up       0.0.0.0:8082->8080/tcp
spring-boot-observability_grafana_1      /run.sh                          Exit 1
spring-boot-observability_loki_1         /usr/bin/loki -config.file ...   Up       0.0.0.0:3100->3100/tcp
spring-boot-observability_postgres_1     docker-entrypoint.sh postgres    Up       0.0.0.0:5432->5432/tcp
spring-boot-observability_prometheus_1   /bin/prometheus --config.f ...   Exit 2
spring-boot-observability_redis_1        docker-entrypoint.sh redis ...   Up       0.0.0.0:6379->6379/tcp
spring-boot-observability_tempo_1        /tempo --target=all --stor ...   Up       0.0.0.0:14250->14250/tcp, 0.0.0.0:4317->4317/tcp
blueswen commented 6 months ago

Maybe port 8080 for Grafana and port 9090 for Prometheus are being used on your machine. If you cannot turn off the services using these ports, modifying the ports of Grafana and Prometheus in docker-compose.yaml is another solution.

For example:

# docker-compose.yaml
...
  prometheus:
    image: prom/prometheus:v2.47.2
    ports:
      - "9091:9090"
...
  grafana:
    image: grafana/grafana:10.2.0
    ports:
      - "3001:3000"
...

With the previous setting, the Grafana Web is on localhost:3001 and the Prometheus Web UI is on localhost:9091.