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.2k
26 Java Years
shintanimoto
0
44
Let’s Have Fun with Reactive Programming, Using Reactor and WebFlux
shintanimoto
0
220
Monitoring and Visualizing Your (Micro)services
shintanimoto
0
330
現代に求められるJavaコミュニティとは / What should be the Java Community of Today?
shintanimoto
0
860
人生がときめく「学び」の魔法 / The Life-Changing Magic of Studying
shintanimoto
6
1.6k
業務で使いたいWebFluxによるReactiveプログラミング / Introduction to Reactive Programming using Spring WebFlux
shintanimoto
9
8.9k
from old Java to modern Java (2017) #jjug
shintanimoto
4
1.5k
Stream API 入門 #jjug #javajo
shintanimoto
4
3.8k
Other Decks in Technology
See All in Technology
visionOSでの空間表現実装とImmersive Video表示について / ai-immersive-visionos
cyberagentdevelopers
PRO
1
110
Figma Dev Modeで進化するデザインとエンジニアリングの協働 / figma-with-engineering
cyberagentdevelopers
PRO
1
430
コンテンツを支える 若手ゲームクリエイターの アートディレクションの事例紹介 / cagamefi-game
cyberagentdevelopers
PRO
1
130
急成長中のWINTICKETにおける品質と開発スピードと向き合ったQA戦略と今後の展望 / winticket-autify
cyberagentdevelopers
PRO
1
160
신뢰할 수 있는 AI 검색 엔진을 만들기 위한 Liner의 여정
huffon
0
380
AWSコンテナ本出版から3年経った今、もし改めて執筆し直すなら / If I revise our container book
iselegant
15
4k
一休.comレストランにおけるRustの活用
kymmt90
3
590
Forget efficiency – Become more productive without the stress
ufried
0
150
VPC間の接続方法を整理してみた #自治体クラウド勉強会
non97
1
890
Jr. Championsになって、強く連携しながらAWSをもっと使いたい!~AWSに対する期待と行動~
amixedcolor
0
190
話題のGraphRAG、その可能性と課題を理解する
hide212131
4
1.5k
君は隠しイベントを見つけれるか?
mujyun
0
300
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
363
19k
Six Lessons from altMBA
skipperchong
26
3.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.8k
Embracing the Ebb and Flow
colly
84
4.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
Ruby is Unlike a Banana
tanoku
96
11k
Done Done
chrislema
181
16k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
It's Worth the Effort
3n
183
27k
The Power of CSS Pseudo Elements
geoffreycrofte
72
5.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
32
2.4k
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!