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
ログのメトリックを取ってみる話
Search
AGAWA Koji
November 04, 2016
Programming
1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ログのメトリックを取ってみる話
logback / Prometheus
AGAWA Koji
November 04, 2016
More Decks by AGAWA Koji
See All by AGAWA Koji
Software Architecture in an AI-Driven World
atty303
80
47k
PipeCDプラグインへの期待 / Anticipating PipeCD Plugins
atty303
0
130
EmscriptenでC/C++アプリをWASM化してブラウザで動かしてみた
atty303
0
680
良いソフトウェアとコードレビュー / Good software and code review
atty303
38
18k
Scala + Caliban で作るGraphQL バックエンド / Making GraphQL Backend with Scala + Caliban
atty303
0
600
Scala.jsとAndroidでドメイン層を共有しよう / Scala.js and Android
atty303
0
820
もう一つのビルドツール mill で作る Docker イメージ / Build docker image with mill the yet another build tool
atty303
2
2.6k
Case of Ad Delivery System is Implemented by Scala and DDD
atty303
4
3.7k
ADC2016: Axion meets HashiCorp
atty303
0
840
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
360
5分で問診!Composer セキュリティ健康診断
codmoninc
0
550
Claude Team Plan導入・ガイド
tk3fftk
0
220
What's New in Android 2026
veronikapj
0
120
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
400
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
200
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
110
自作OSでスライド発表する
uyuki234
1
3.9k
FDEが実現するAI駆動経営の現在地
gonta
2
200
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
120
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
530
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
6.7k
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
450
Scaling GitHub
holman
464
140k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
470
Code Reviewing Like a Champion
maltzj
528
40k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.2k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.7k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
420
The Curious Case for Waylosing
cassininazir
1
440
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
The untapped power of vector embeddings
frankvandijk
2
1.8k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
240
Transcript
ϩάͷϝτϦοΫΛऔͬͯΈΔ @atty303 / AI Studio Dev Group © 2016 CyberAgent,
Inc. 1
ELK stack ͱ͔Ͱϩάऩू͢ ΔΑ͋͘Δ © 2016 CyberAgent, Inc. 2
ϩάͷϝτϦοΫΛܭଌ͢ Δ͋Μ·Γͳͦ͞͏? © 2016 CyberAgent, Inc. 3
͜Μͳײ͡Ͱܭଌͯ͠·͢ 4 DEBUG Ϩϕϧ͔͠ग़͍ͯͳ͍ͷͰ͍·͍ͪ໘നΈ ͳ͍… © 2016 CyberAgent, Inc. 4
4 ϞχλϦϯάʹ Prometheus Λར༻ 4 Prometheus ެࣜͷ Java ΫϥΠΞϯτ 4
https://github.com/prometheus/ client_java 4 simpleclient_logback Ϟδϡʔϧ 4 ϨϕϧผʹϝοηʔδΛܭଌͯ͠ϝτϦ οΫͱͯ͠ग़ྗͯ͘͠ΕΔ Logback ͷ Appender © 2016 CyberAgent, Inc. 5
logback.xml <configuration> <appender name="COUNTER" class="io.prometheus.client.logback.InstrumentedAppender"> </appender> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <filter
class="ch.qos.logback.classic.filter.ThresholdFilter"> <level>${LOG_STDOUT_LEVEL:-INFO}</level> </filter> <encoder> <pattern>%.-1level %d{MMdd HH:mm:ss.SSS} %thread [%logger{36}] %msg%n</pattern> </encoder> </appender> <root level="DEBUG"> <appender-ref ref="COUNTER" /> <appender-ref ref="STDOUT" /> </root> </configuration> © 2016 CyberAgent, Inc. 6
ϙΠϯτ 4 ϧʔτϩΨʔશϩάΛ appender ʹૹΔ 4 STDOUT appender ͷ ThreasholdFilter
Ͱ ͳϩάΛϑΟϧλϦϯά 4 COUNTER appender ͕ϩάϨϕϧผͷϝο ηʔδΛΧϯτ © 2016 CyberAgent, Inc. 7
ϝτϦοΫܭଌͯ͘͠ΕΔ $ curl http://somewhere:58165/metrics # HELP logback_appender_total Log4j log statements
at various log levels # TYPE logback_appender_total counter logback_appender_total{level="debug",} 8.9142634E7 logback_appender_total{level="warn",} 0.0 logback_appender_total{level="trace",} 0.0 logback_appender_total{level="error",} 2728.0 logback_appender_total{level="info",} 11.0 © 2016 CyberAgent, Inc. 8
ϩάϨϕϧͷఆٛ DEBUG: ։ൃऀʹ͔͠ඞཁͳ͍ใ INFO: ΞϓϦέʔγϣϯͷॲཧঢ়گͳͲਖ਼ৗಈ࡞ Λ͍ͯ͠Δ࣌ͷใ WARN: Τϥʔ͕ग़͕ͨճ෮ग़དྷͨ࣌ͷใ ERROR: Τϥʔ͕ग़ͯճ෮ग़དྷ͖ͳ͍࣌ͷใ
4 ͪΌΜͱϩάϨϕϧͷҙຯ͚Λ͍ͯ͠ͳ͍ͱ ܭଌͯ͠ແҙຯ… © 2016 CyberAgent, Inc. 9
Ξϥʔτϧʔϧ IF rate(logback_appender_total{job="axion-inserter-admin",level="error"}[1m]) > 1 FOR 1m LABELS { severity
= "LOW" } ANNOTATIONS { summary = "Inserter: {{ $value }} error messages found at {{ $labels.instance }}" } 4 ͱΓ͋͑ͣ ERROR ϩά͕ग़͍ͯͨΒΞϥʔ τ 4 ϝοηʔδίϯςφΛݟʹߦ͘… nomad fs <alloc-id> alloc/logs/inserter.stdout.0 © 2016 CyberAgent, Inc. 10
…ͯͳӡ༻Λͯ͠·͢ © 2016 CyberAgent, Inc. 11
ྑ͍ͱ͜Ζ 4 ϩάऩूΑΓѹతʹτϥϑΟοΫ͕খ͍͞ͷ ͰؾָʹಋೖͰ͖Δ 4 ϩάϨϕϧ͚ͩͰҙ֎ͱগͳ͍࿑ྗͰࢹͰ ͖Δ 4 ࢹΛҙࣝͨ͠ϩάग़ྗඞཁ ©
2016 CyberAgent, Inc. 12
ѱ͍ͱ͜Ζ 4 ͕ى͖ͨͱ͖݁ہϝοηʔδΛݟʹߦ͔ ͳ͍ͱ͍͚ͳ͍ 4 ϩάऩूͷΈ͕༻ҙ͞Ε͍ͯΕͦͷ΄͏ ͕ྑ͍ © 2016 CyberAgent,
Inc. 13
GCP ͷ Stackdriver ͏Β·͍͠ © 2016 CyberAgent, Inc. 14
© 2016 CyberAgent, Inc. 15