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
AGIについてChatGPTに聞いてみた
blueb
0
130
日経電子版のStoreKit2フルリニューアル
shimastripe
1
140
The Rise of LLMOps
asei
7
1.7k
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
DynamoDB でスロットリングが発生したとき_大盛りver/when_throttling_occurs_in_dynamodb_long
emiki
1
430
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
320
TypeScript、上達の瞬間
sadnessojisan
46
13k
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
300
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
420
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
880
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
13k
組織成長を加速させるオンボーディングの取り組み
sudoakiy
2
200
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
73
9.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
A designer walks into a library…
pauljervisheath
204
24k
Optimizing for Happiness
mojombo
376
70k
What's new in Ruby 2.0
geeforr
343
31k
10 Git Anti Patterns You Should be Aware of
lemiorhan
655
59k
Building Adaptive Systems
keathley
38
2.3k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
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!