项目作者: xmlking

项目描述 :
🎉 Microservices Observability - Log Aggregation, Distributed Tracking, Metrics
高级语言: Kotlin
项目地址: git://github.com/xmlking/microservices-observability.git
创建时间: 2017-09-22T07:39:55Z
项目社区:https://github.com/xmlking/microservices-observability

开源协议:MIT License

下载


Build Status
codecov.io
GitHub license
Join the chat at https://gitter.im/xmlking/microservices-observability

microservices-observability

As Developers are migrating from Monolithic architecture to distributed microservices and Service Mesh, troubleshooting production issues become difficult.

This sample application showcases patterns to implement better Observability at web scale.

Reactive

Log Aggregation

Reactive

Highlights

  • Ready to go docker configuration for set up GILK logging stack in a minutes.
    • GILK - Grafana , InfluxDB, Logstash json format, Kafka
  • Monitoring solution for docker hosts and containers with Prometheus, Grafana, cAdvisor,
    NodeExporter and alerting with AlertManager.
  • Vendor-neutral instrumentation
  • end-to-end Functional Reactive Programming (FRP) with Spring 5.
  • Multi-project builds with Gradle Kotlin Script.
  • Spring Kotlin Support
  • Docker deployment

Prerequisites

  1. Gradle 4.4 (Install via sdkman)
  2. Docker for Mac Setup Instructions

Build

  1. # build all 3 executable jars
  2. gradle build
  3. # continuous build with `-t`.
  4. # this shoud be started before any run tasks i.e., `gradle ui-app:bootRun`, for spring's devtools to work.
  5. gradle build -x test -t
  6. # build all 3 apps
  7. gradle build -x test
  8. # build all 3 docker images
  9. gradle docker -x test

Test

  1. gradle test

Run

Manual
  1. # start infra services
  2. docker-compose -f docker-compose-infra.yml up cassandra
  3. docker-compose -f docker-compose-infra.yml up kafka
  4. docker-compose -f docker-compose-infra.yml up influxdb

Start all 4 apps with gradle xyz:bootRun : cassandra-data-service, stream-service, ui-app , kafka-influxdb-service

If you want to debug the app, add —debug-jvm parameter to Gradle command line

Docker

You can also build Docker images and run all via Docker Compose

  1. # start containers in the background
  2. docker-compose up -d
  3. # start containers in the foreground
  4. docker-compose up
  5. # show runnning containers
  6. docker-compose ps
  7. # scaling containers and load balancing
  8. docker-compose scale stream=2
  9. # 1. stop the running containers using
  10. docker-compose stop
  11. # 2. remove the stopped containers using
  12. docker-compose rm -f
  13. # just start only infra services
  14. docker-compose -f docker-compose-infra.yml up
  15. # connect(ssh) to a service and run a command
  16. docker-compose exec cassandra cqlsh
  17. # see logs of a service
  18. docker-compose logs -f stream
  19. # restart single service
  20. docker-compose restart stream
  21. # start single service
  22. docker-compose -f docker-compose-infra.yml up cassandra
  23. docker-compose -f docker-compose-infra.yml up kafka
  24. docker-compose -f docker-compose-infra.yml up influxdb
  25. # check health for a service
  26. docker inspect --format "{{json .State.Health.Status }}" microservicesobservability_app_1
  27. docker ps
  28. docker-compose -f docker-compose-fluentd.yml up

Access UI App at http://localhost:8080

Prometheus http://localhost:9090/graph

InfluxDB http://localhost:8083

Grafana http://localhost:1634

Gradle Commands

  1. # upgrade project gradle version
  2. gradle wrapper --gradle-version 4.4.1 --distribution-type all
  3. # gradle daemon status
  4. gradle --status
  5. gradle --stop
  6. # refresh dependencies
  7. gradle build -x test --refresh-dependencies

Reference