Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Spring Cloud Sleuth + Zipkin with Elasticsearc...
Search
Shin Tanimoto
June 13, 2017
Technology
1
1.2k
Spring Cloud Sleuth + Zipkin with Elasticsearch #zipkin_jp
Zipkin Meetup #1
https://zipkin.connpass.com/event/58716/
Shin Tanimoto
June 13, 2017
Tweet
Share
More Decks by Shin Tanimoto
See All by Shin Tanimoto
クラウドネイティブ時代のコンテナ環境におけるJavaアプリケーションのメトリクス・ログ・トレースモニタリング
shintanimoto
5
2.3k
26 Java Years
shintanimoto
0
63
Let’s Have Fun with Reactive Programming, Using Reactor and WebFlux
shintanimoto
0
260
Monitoring and Visualizing Your (Micro)services
shintanimoto
0
360
現代に求められるJavaコミュニティとは / What should be the Java Community of Today?
shintanimoto
0
920
人生がときめく「学び」の魔法 / The Life-Changing Magic of Studying
shintanimoto
6
1.7k
業務で使いたいWebFluxによるReactiveプログラミング / Introduction to Reactive Programming using Spring WebFlux
shintanimoto
9
9.3k
from old Java to modern Java (2017) #jjug
shintanimoto
4
1.6k
Stream API 入門 #jjug #javajo
shintanimoto
4
3.9k
Other Decks in Technology
See All in Technology
一人QA時代が終わり、 QAチームが立ち上がった話
ma_cho29
0
290
DevinはクラウドエンジニアAIになれるのか!? 実践的なガードレール設計/devin-can-become-a-cloud-engineer-ai-practical-guardrail-design
tomoki10
3
1.4k
ISUCONにPHPで挑み続けてできるようになっ(てき)たこと / phperkaigi2025
blue_goheimochi
0
140
Enterprise AI in 2025?
pamelafox
0
110
LINE Notify互換のボットを作った話
kenichirokimura
0
180
Explainable Software Engineering in the Public Sector
avandeursen
0
370
SpannerとAurora DSQLの同時実行制御の違いに想いを馳せる
masakikato5
0
570
お問い合わせ対応の改善取り組みとその進め方
masartz
1
430
Go の analysis パッケージで自作するリファクタリングツール
kworkdev
PRO
1
430
コンソールで学ぶ!AWS CodePipelineの機能とオプション
umekou
2
120
Symfony in 2025: Scaling to 0
fabpot
2
220
「ラベルにとらわれない」エンジニアでいること/Be an engineer beyond labels
kaonavi
0
170
Featured
See All Featured
A designer walks into a library…
pauljervisheath
205
24k
Rails Girls Zürich Keynote
gr2m
94
13k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
118
51k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
102
18k
Making Projects Easy
brettharned
116
6.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
The Pragmatic Product Professional
lauravandoore
33
6.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
12
620
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
177
52k
Mobile First: as difficult as doing things right
swwweet
223
9.5k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Transcript
Spring Cloud Sleuth + Zipkin with Elasticsearch Shin Tanimoto Acroquest
Technology Co., LTD
Copyright © Acroquest Technology Co., Ltd. All rights reserved. ࣗݾհ
2 • ୩ຊ ৺ (Shin Tanimoto) - Acroquest Technologyגࣜձࣾ - ࠷ۙElasticsearchؔͷࣄ - ຊJavaϢʔβʔάϧʔϓ - JavaOne / SpringOneεϐʔΧʔ - Twitter : @cero_t - Facebook : shin.tanimoto
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3 ࢲͱzipkinͷग़ձ͍ 2લ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4 ϚΠΫϩαʔϏε։ൃΛ͓ͯ͠Γ ʮαʔϏεͷґଘؔʯ͕͔Βͳ͍ ͱ͍͏͕ݦࡏԽ͍ͯͨ͠ͷͰ Կ͔πʔϧΛ࡞Ζ͏ͱߟ͍͑ͯͨ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 5 ͋ΔΑʂ by Josh Long
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6 Spring Cloud ͢ΓΎʔ͢ ʢຊਓʹฉ͖औΕͳ͍ӳޠʣ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 7 ຊͷςʔϚɿ Spring Cloud Sleuthͱ zipkinΛ༻͍ͨ ʮϚΠΫϩαʔϏεͷՄࢹԽʯ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 8 αʔϏε͕૿͑Δͱ ৽͍͠ࠔΓ͝ͱ͕ ৭ʑͱग़ͯ͘Δ݅
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 9 #1 ϚΠΫϩαʔϏε։ൃ ͷۤ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 1. ϚΠΫϩαʔϏε։ൃͷۤ JAR Hell͔ΒService Hell αʔϏεͷ͕૿େ͢Δ͜ͱͰ αʔϏεಉ࢜ͷґଘ͕͔ؔΒͳ͘ͳΔ ͜ͷαʔϏεΛվम͢ΔͱͲ͜ʹӨڹ͢Δʁ ͍·ى͖ͨΤϥʔͲ͕͜ݪҼͳͷʁ ͦͦΘΕͯͳ͍αʔϏεͳ͍ͷʁ 10
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 1. ϚΠΫϩαʔϏε։ൃͷۤ ӡ༻ऀͩͬͯࠔΔ ࢹ͖͢αʔόϓϩηεͷ͕ଟ͍ ͯ͢ͷαʔόͷσΟεΫϝϞϦେৎʁ 1000ݸͷϓϩηεͯ͢ਖ਼ৗʹಈ͍͍ͯΔʁ ϩάϑΝΠϧ͕ࢄͯ͠͠·͏ ͍·ى͖ͨΤϥʔΛௐΔͨΊʹɺ ͲͷϩάϑΝΠϧΛݟΕ͍͍ͷʁ 11
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 1. ϚΠΫϩαʔϏε։ൃͷۤ 12 ཱʹΑͬͯۤҟͳΔ͕ ͍ͣΕʹͤΑαʔϏε͚ͩͰͳ͘ αʔόϩά͕૿͑ͨ͜ͱͰ ݟΔ͖ͷ͕ࡶԽ͢Δ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 13 ͦ͜ͰՄࢹԽͰ͢Α
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 14 #2 ՄࢹԽʹ͏πʔϧ܈
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 2. ՄࢹԽʹ͏πʔϧ܈ ͨͱ͑͜͏͍͏πʔϧ܈ αʔϏεؒͷґଘੑΛՄࢹԽʢࠓͭ͢ʣ Elasticsearch + Spring Cloud Sleuth + Zipkin ϩάϑΝΠϧΛՄࢹԽʢࠓ͞ͳ͍ͭʣ Elasticsearch + Logstash + Kibana + Filebeat αʔόϓϩηεͷঢ়ଶΛՄࢹԽʢࠓ͞ͳ͍ͭʣ Elasticsearch + Kibana + Metricbeat 15
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 16 ඦฉҰݟʹ͔ͣ͠
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 2. ՄࢹԽʹ͏πʔϧ܈ Spring Cloud Sleuth + Zipkin 17 ϘτϧωοΫ Λ୳͢
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 18 #3 αʔϏεґଘੑͷ ՄࢹԽ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ ԿͷͨΊʹΔͷʁ αʔϏεͷվम࣌ʹɺͦͷӨڹൣғΛ֬ೝ͍ͨ͠ Τϥʔ͕ൃੜͨ͠ࡍʹɺ֬ೝ͖͢ൣғΛಛఆ͍ͨ͠ ͠ɺ࣮ࡍʹΘΕ͍ͯͳ͍αʔϏε͕͋Εఀࢭ ͍ͨ͠ → ओʹ։ൃऀ͚ͷՄࢹԽͰ͋Δ 19
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Spring Cloud Sleuth + ZipkinͰαʔϏεґଘੑΛՄࢹԽ Spring Cloud Sleuthͱʁ Distributed Tracing ෳαʔόΛލ͕ΔϦΫΤετʹڞ௨ͷIDΛৼͬͯ ʢHTTP/AMQPϔομͳͲͰͤ͞ͳ͕Βʣ ॲཧΛͰ͖ΔΑ͏ʹ͢ΔΈ Zipkinͱʁ Distributed Tracing Visualization ෳαʔόΛލ͕ΔϦΫΤετΛՄࢹԽ͢Δ 20
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Spring Cloud Sleuth + ZipkinͷΠϝʔδ 21 Microservice1 Microservice2 طʹ࡞ͬͯ͋Δ ϚΠΫϩαʔϏε
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Spring Cloud Sleuth + ZipkinͷΠϝʔδ 22 Microservice1 Microservice2 Zipkin Server HTTP Zipkin UI Server SleuthΛͬͯ ݺͼग़͠ใΛ zipkinʹૹΔ ੵ ՄࢹԽ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Spring Cloud Sleuth + Zipkinͷద༻ Spring Cloud Sleuth ϚΠΫϩαʔϏεͷpom.xmlͷdependenciesʹ ʮspring-cloud-starter-zipkinʯΛՃ ίʔυͷมߋҰͳ͠ Zipkin ৽نϓϩδΣΫτΛ࡞ͬͯpom.xmlʹ ʮzipkin-serverʯͱʮzipkin-autoconfigure-uiʯΛՃ MainΫϥεΛҰͭ࡞Δ 23
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Zipkinαʔόͷ։ൃ 24 @SpringBootApplication @EnableZipkinServer public class ZipkinApplication { public static void main(String[] args) { SpringApplication.run(ZipkinApplication.class, args); } }
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Spring Cloud Sleuth + ZipkinͷΠϝʔδ 25 Microservice1 Microservice2 Zipkin Server HTTP Zipkin UI Server Zipkin Client (spring-cloud-starter-zipkin) Zipkin UI (zipkin-autoconfigure-ui) Zipkin Server (zipkin-server)
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. ͦΖͦΖσϞ 26 Demo
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 27 ͜͏͍͏ࣄ͕؆୯ʹͰ͖Δ͔Β Spring CloudΛ͏Μͩ ͍ͬͯ͏ײ֮ɺ͋Γ·͢
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ ͏গ͠৴པੑͷߴ͍ऩू 28 Microservice1 Microservice2 Zipkin Server Zipkin UI Server Kafka
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ ͏গ͠৴པੑͷߴ͍ऩू 29 Microservice1 Microservice2 Zipkin Server Zipkin UI Server Kafka spring-cloud-sleuth-stream spring-cloud-stream-binder-kafka zipkin-autoconfigure-ui spring-cloud-sleuth-zipkin-stream spring-cloud-stream-binder-kafka
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Spring Cloud Sleuth + ZipkinͷΠϝʔδ 30 Name artifactId Log HTTP Kafka Sleuth spring-cloud-starter-sleuth Service Sleuth Stream spring-cloud-sleuth-stream Service Zipkin Client spring-cloud-starter-zipkin Service Zipkin Stream spring-cloud-sleuth-zipkin-stream Zipkin Zipkin UI spring-boot-starter zipkin-autoconfigure-ui Zipkin Zipkin Zipkin Server spring-boot-starter zipkin-server Zipkin Stream Kafka spring-cloud-stream-binder-kafka Both
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 31 ʢ࠶ʣ ͜͏͍͏ࣄ͕؆୯ʹͰ͖Δ͔Β Spring CloudΛ͏Μͩ ͍ͬͯ͏ײ֮ɺ͋Γ·͢
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 32 #4 ElasticsearchʹΑΔ ӬଓԽ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ElasticsearchʹΑΔӬଓԽ 33 όοΫΤϯυin-memoryҎ֎ʹ MySQLɺCassandra ElasticsearchͳͲ͕બΔ͚Ͳ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ElasticsearchʹΑΔӬଓԽ 34 όοΫΤϯυΛ Elasticsearchʹ͢Ε Kibanaͱ͔ͰՄࢹԽͰ͖Μ͡ΌͶʁ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ElasticsearchʹΑΔӬଓԽ ElasticsearchʹΑΔZipkinͷӬଓԽ ґଘϥΠϒϥϦͷՃ zipkinϓϩδΣΫτͷpom.xmlͷdependenciesʹ ʮzipkin-autoconfigure-storage-elasticsearch-httpʯΛՃ -elasticsearch-awsAmazon ESઐ༻ʢͨͿΜʣ zipkinϓϩδΣΫτͷapplication.ymlʹ ʮzipkin.storage.type: elasticsearchʯΛՃ 35
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. ͏ҰσϞ 36 Demo
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ElasticsearchʹΑΔӬଓԽ 37 ·ͩ͋Μ·ΓKibanaͰ ՄࢹԽͰ͖ΜΜɾɾɾ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ElasticsearchʹΑΔӬଓԽ 38 ࠓޙʹظɾɾɾʁ Zipkin v2 span model #939 https://github.com/openzipkin/zipkin/issues/939
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 39 ·ͱΊ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. ·ͱΊ Spring BootͰ։ൃ͍ͯ͠Δօ͞Μ Spring Cloud SleuthͱZipkinʹΑΔ αʔϏεґଘੑͷՄࢹԽ͙͢Ͱ͖ΔΑ ElasticsearchʹσʔλΛอଘ͢Δ͜ͱͰ͖Δ͚Ͳ ՄࢹԽ͢Δʹͪΐͬͱ·ͩਏ͍͔ͳ ͪͳΈʹোγεςϜఀࢭ͕ى͖Δ͜ͱେલఏͱͯ͠ɺ KafkaΛ༻͍ͨ҆ఆԽΛݕ౼͢Εɺؾ͍ͮͨΒSpring Cloud Stream όοΫϓϨογϟʔͷϝϦοτ͕͔ΔΑ͏ʹͳΔΑʂ ʢݸਓͷײͰ͢ʣ 40
Copyright © Acroquest Technology Co., Ltd. All rights reserved. 41
Enjoy visualizing your Spring Cloud Applications!