diff --git a/docker-compose-zipkin.yml b/docker-compose-zipkin.yml new file mode 100644 index 000000000..8545bf7b4 --- /dev/null +++ b/docker-compose-zipkin.yml @@ -0,0 +1,36 @@ +version: '2' + +services: + carts: + image: weaveworksdemos/carts + hostname: carts + restart: always + cap_drop: + - all + cap_add: + - NET_BIND_SERVICE + read_only: true + tmpfs: + - /tmp:rw,noexec,nosuid + environment: + - reschedule=on-node-failure + - ZIPKIN=zipkin + ports: + - "8081:80" + zipkin: + image: openzipkin/zipkin + hostname: zipkin + restart: always + cap_drop: + - all + cap_add: + - CHOWN + - SETGID + - SETUID + read_only: true + tmpfs: + - /tmp:rw,noexec,nosuid + environment: + - reschedule=on-node-failure + ports: + - "9411:9411" diff --git a/pom.xml b/pom.xml index 465a3ea0a..cd2953a1a 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,11 @@ org.springframework.boot spring-boot-starter-actuator + + org.springframework.cloud + spring-cloud-starter-zipkin + 1.1.0.RELEASE + io.prometheus simpleclient diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 7b7638f99..09658b346 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,3 +1,6 @@ server.port=${port:8081} spring.data.mongodb.uri=mongodb://${db:cart-db}:27017/data endpoints.health.enabled=false +spring.zipkin.baseUrl=http://${zipkin:zipkin}:9411/ +spring.sleuth.sampler.percentage=1.0 +spring.application.name=carts