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
La métrologie dans les applications Scala
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Matthieu Guillermin
October 28, 2016
Programming
150
0
Share
La métrologie dans les applications Scala
Talk Scala.IO 2016
Matthieu Guillermin
October 28, 2016
Other Decks in Programming
See All in Programming
事業会社でのセキュリティ長期インターンについて
masachikaura
0
250
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
23
13k
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
180
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
140
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
160
Agentic Elixir
whatyouhide
0
320
CDK Deployのための ”反響定位”
watany
4
780
Vibe NLP for Applied NLP
inesmontani
PRO
0
440
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
110
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
110
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
290
Running Swift without an OS
kishikawakatsumi
0
840
Featured
See All Featured
Bash Introduction
62gerente
615
210k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.9k
エンジニアに許された特別な時間の終わり
watany
106
240k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
720
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.2k
A Soul's Torment
seathinner
6
2.7k
The Language of Interfaces
destraynor
162
26k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
260
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
260
Unsuck your backbone
ammeep
672
58k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
890
Leo the Paperboy
mayatellez
7
1.7k
Transcript
La métrologie dans les applications Scala Matthieu Guillermin Scala.IO 2016
Matthieu Guillermin Lead Dev Brainify - Analytics e-commerce
Est-ce que mon service fonctionne ? Est-ce que les temps
de réponse sont corrects ? Est-ce que mon service renvoie des erreurs 500 ? Il y a beaucoup d'erreurs, qu'est-ce qui cloche ? « Ça fait 1 heure que l'appli ne fonctionne plus, qu'est-ce qu'il se passe ? »
Logs • Disponible dans toutes les applications • Très détaillé
• Difficile à exploiter • Difficile d'avoir une vision synthétique
Métriques • Valeurs numériques • Facile à stocker • Facile
à exploiter • Affichage • Triggers / Alertes
Statsd / Graphite Cabot Service A Kamon Service B Kamon
Service C Kamon Grafana system C* ES Kafka Kong
Enregistrement des métriques
Kamon • JVM / Scala • Reactive-friendly • Modulaire •
http://kamon.io
Kamon - Metrics • Flush interval • Instruments • Counter
• Histogram • ...
// Counter val authCounter = Kamon.metrics.counter("auth") def auth(username: String, password:
String) = { authCounter.increment() // ... } // Histogram val docSizeHistogram = Kamon.metrics.histogram("doc-size") def storeDocument(doc: Document) = { docSizeHistogram.record(doc.size) // ... }
Kamon - Trace • Enregistrement du "temps passé" • Granularité
: Traces / Segments
def userCreate(user: User) = { val context = Kamon.tracer.newContext("userCreate") //
... validateUser(user) // ... context.finish() } def validateUser(user: User) = { val segment = Tracer.currentContext.startSegment("validateUser", "myCategory", "myLib") // ... segment.finish() }
def userCreate(user: User) = { Tracer.withNewContext("userCreate", autoFinish = true) {
validateUser(user) // ... } } def validateUser(user: User) = { Tracer.currentContext.withNewSegment("validateUser", "cat", "lib") { // ... } }
def notifyUser(user: User) = { Tracer.currentContext.withNewAsyncSegment("notifyUser", "cat", "lib") { sendEmail(user.email)
// sendEmail() is returning a Future } }
Kamon - Intégrations • JVM : • Heap, GC, ...
• Akka : Metrics sur Actor, Router, Dispatcher • Ex : time-in-mailbox, processing-time, errors,... • Play : Metrics sur requêtes HTTP • Ex : requêtes entrantes, WSClient,...
class User @Inject()(val userService: UserService) extends Controller { def create(username:
String, password: String) = TraceName("user-create") { Action.async { userService.create(username, password) .map(user => Ok(Json.toJson(user))) } } }
kamon { statsd { hostname = my.statsd.server flush-interval = 1
minute simple-metric-key-generator { application = "my-service" } } metric { tick-interval = 1 minute filters { akka-actor { includes = ["application/user/**"] # excludes = [] } } } system-metrics { sigar-enabled = false jmx-enabled = true } }
Visualisation des métriques
Grafana • Visualisation des métriques • Dashboards • Templating /
annotations • http://grafana.org/
None
None
None
Alerting
Alerting • Etre alerté d'un incident - hits / last
2 minutes = 0 - 2xx_status = 0
Alerting • Prévenir un incident - heap_usage > 90% -
disk_free < 10% - response_time > 200ms
Cabot • Services / Checks • ICMP / HTTP /
Graphite • Notifications • Slack • Twilio (SMS / Phone) http://cabotapp.com/
None
None
None
None
Conclusion • Mettre en place de la métrologie • Investissement
qui en vaut la peine • Simple • Dev + Ops • Processus itératif