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
46
Let’s Have Fun with Reactive Programming, Using Reactor and WebFlux
shintanimoto
0
230
Monitoring and Visualizing Your (Micro)services
shintanimoto
0
330
現代に求められるJavaコミュニティとは / What should be the Java Community of Today?
shintanimoto
0
870
人生がときめく「学び」の魔法 / The Life-Changing Magic of Studying
shintanimoto
6
1.6k
業務で使いたいWebFluxによるReactiveプログラミング / Introduction to Reactive Programming using Spring WebFlux
shintanimoto
9
9k
from old Java to modern Java (2017) #jjug
shintanimoto
4
1.5k
Stream API 入門 #jjug #javajo
shintanimoto
4
3.9k
Other Decks in Technology
See All in Technology
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.3k
スクラムチームを立ち上げる〜チーム開発で得られたもの・得られなかったもの〜
ohnoeight
2
350
TypeScript、上達の瞬間
sadnessojisan
46
13k
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
300
Taming you application's environments
salaboy
0
180
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
3
190
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.6k
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
470
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
220
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
49
11k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Facilitating Awesome Meetings
lara
50
6.1k
Designing for humans not robots
tammielis
250
25k
Statistics for Hackers
jakevdp
796
220k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Building Your Own Lightsaber
phodgson
103
6.1k
Why Our Code Smells
bkeepers
PRO
334
57k
Fireside Chat
paigeccino
34
3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
The Invisible Side of Design
smashingmag
298
50k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
860
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!