SlideShare a Scribd company logo
1 of 30
Download to read offline
2017年の
LINEのマイクロサービスを
⽀えるSpring
Masahiro Ide, LINE Corporation
@imasahiro
https://github.com/imasahiro
Self Intro
l Masahiro Ide
l Server side engineer at LINE
l Mainly worked on スタンプ/着せかえ ショップ
l Contribute to Armeria - Asynchronous RPC/REST library
l https://github.com/line/armeria
• Where is Spring used at LINE?
• Useful/Customized Spring features
• Monitoring
Agenda
LINE
LINE System
l LINE has hundreds of applications
l Recent apps are Java/Spring applications
l Mainly communicates with Thrift, and REST
l Uses same in-house deployment, monitoring system
今⽇お話しするLINEのシステム
lスタンプショップ
スタンプショップ
l Spring-boot 1.5.8, Spring-MVC
l Mostly Asynchronous Http/2 Thrift/REST service
l Java8, RxJava2, (Completable|Listenable)Future
l Storage
l Redis, MySQL, Mongo, ElasticSearch
l Monitoring
l Micrometer, Dropwizard Metrics, Prometheus, Zipkin
Sticker server Mongo
MySQL
ElasticSearch
Redis
LINE Client
Theme server Search server
STORE Server
スタンプショップ 構成
スタンプショップ
l Spring-boot 1.5.8, Spring-MVC
l Mostly Asynchronous Http/2 Thrift/REST service
l Java8, RxJava2, (Completable|Listenable)Future
l Storage
l Redis, MySQL, Mongo, ElasticSearch
l Monitoring
l Micrometer, Dropwizard Metrics, Prometheus, Zipkin
l Easy to setup
l Have many integrations with other libraries
l Mybatis, Thymeleaf, Tomcat, etc.
Why spring, why spring-boot?
@SpringBootApplication
public class SampleApp {
@Configuration
class MvcConf extends WebMvcConfigurerAdapter {…}
public static void main(String[] args) {
SpringApplication.run(SampleApp.class, args);
}
}
Simple & Useful Spring features
1. Spring cache abstraction
1. (Spring) AOP
2. Dependency management
1. Spring Cache Abstraction
l SpringにおけるCacheの抽象化
l Can choose cache implementation
l Redis, Caffeine, Guava, etc.
l …But need to use carefully on async service
@Cacheable(cacheNames = "listCache")
List<Item> selectByLang(String lang) {
return sqlSession.selectList(…);
}
Async support in cache abstraction
lNaive (and wrong) solution
l This just caches a Future…
l But donʼt cache value in Future
l See https://jira.spring.io/browse/SPR-12967
@Cacheable(cacheNames = "listCache")
CompletableFuture<List<Item>> selectByLang(String lang) {
return CompletableFuture.supplyAsync(
() -> sqlSession.selectList(…), executor);
}
Async support in cache abstraction
lMade similar cache abstraction
l with Caffeine AsyncLoadingCache and
Lettuce (Async redis client)
@AsyncCacheable(cacheNames = "listCache")
CompletableFuture<List<Item>> selectByLang(String lang) {
return CompletableFuture.supplyAsync(
() -> sqlSession.selectList(…), executor);
}
Simple & Useful Spring features
1. Spring cache abstraction
1. (Spring) AOP
2. Dependency management
2. (Spring) AOP
lAOP - Aspect Oriented Programming
l Use case: logging, perf instrumentation
@Loggable @GetMapping(“/”)
ModelAndView home(…) {…}
@Around("@annotation(Loggable)")
public Object logging(ProceedingJoinPoint pjp) {
Timer timer = newTimer()
try {
return pjp.proceed();
} finally {
long latency = timer.stop();
logger.info(“request path: {}, args:{}, latency:{}”, …, latency));
}
}
Client side MySQL sharding using AOP
ApplicationApplication
MySQL Slave
MySQL Master
Shard01
MySQL Slave
MySQL Master
Shard01
MySQL Slave
MySQL Master
Shard01
@Shardable
List<Item> selectListByUserId(int id) {…}
List<DataSource> dataSources = …;
@Around("@annotation(Shardable)")
Object sharding(ProceedingJoinPoint pjp) {
int id = getArguments(pjp)[0];
source = dataSrouces.get(id % 12);
useDataSource(source);
return pjp.proceed();
}
3. Dependency management
lBOM and Dependency management plugin
lSpringがlibrary versionを管理してくれる
dependencyManagement {
imports {
mavenBom 'io.spring.platform:platform-bom:Brussels-SR5'
}
dependencies {
dependencySet(group: 'com.linecorp.armeria', version: '0.55.0') {
entry 'armeria-tomcat-shaded’
entry 'armeria-thrift0.9-shaded'
}
dependency 'biz.paluch.redis:lettuce:4.4.1.Final’
…
}}
スタンプショップ
l Spring-boot 1.5.8, Spring-MVC
l Mostly Asynchronous Http/2 Thrift/REST service
l Java8, RxJava2, (Completable|Listenable)Future
l Storage
l Redis, MySQL, Mongo, ElasticSearch
l Monitoring
l Micrometer, Dropwizard Metrics, Prometheus, Zipkin
How to make a service asynchronous?
l元々はTomcat+Spring MVC or thrift+DBなシステム
@Repository public class ShopStorage {
List<Item> selectByLang(String lang) {
return sqlSession.selectList(
“shop.selectByLang”, lang);
}}
@Controller public class ShopController {
@ResponseBody List<Item> home() {
return storage.getList();
}}
How to make a service asynchronous?
lSync accessを1つずつAsyncに書き直す
@Repository public class ShopStorage {
List<Item> selectByLang(String lang) {
return sqlSession.selectList(
“shop.selectByLang”, lang);
}}
@Controller public class ShopController {
@ResponseBody List<Item> home() {
return storage.getList();
}}
@Repository public class AsyncShopStorage {
CompletableFuture<List<Item>>
selectByLang(String lang) {
return CompletableFuture.supplyAsync(
() -> sqlSession.selectList(
“shop.selectByLang”, lang),
executor);
}}
@Controller public class AsyncShopController {
@ResponseBody
DeferredResult<List<Item>> home() {
result = new DeferredResult<>();
storage.getList()
.thenApply(result::setResult);
return result;
}}
• Where is Spring used at LINE?
• Useful/Customized Spring features
• Monitoring
Agenda
How to observe our services?
lLog
l その瞬間に何が起こったかを確認する
lMetric
l 現在起きている現象のトレンドを確認する
lTrace
l システム間で何が何が起きているかを確認する
How to observe our services?
lLog
l Slf4j + Kibana
lMetric
l Micormeter, Prometheus, Dropwizard metrics
l Grafana
lTrace
l Zipkin
l io.zipkin.brave:brave-instrumentation-mysql
l io.zipkin.brave:brave-instrumentation-spring-webmvc
l And elasticsearch, mongo, redis integrations, etc.
Micrometer
l Supports multiple monitoring tools
l Dropwizard Metrics, Prometheus, etc.
l Will be provide as a Spring Boot 2.0 metrics collection
l Already used in production servers
l Found some concurrency issues but now looks stable
l https://github.com/micrometer-metrics/micrometer/issues/139
l https://github.com/micrometer-metrics/micrometer/issues/172
l https://github.com/micrometer-metrics/micrometer/issues/208
Prometheus
lSimple TSDB, Pull型
lSupports querying, alerting
Application
# HELP armeria_client_response_duration_seconds
# TYPE armeria_client_response_duration_seconds summary
armeria_client_response_duration_seconds{method="sendMessage",
service=”Service",quantile="0.5",} 8.194E-4
armeria_client_response_duration_seconds{method="sendMessage",
service=”Service",quantile="0.75",} 9.494E-4
armeria_client_response_duration_seconds{method="sendMessage",
service=”Service",quantile="0.90",} 9.994E-4
…
/internal/metrics
Node exporterPrometheus
pull ApplicationNode exporter
Micrometer+Prometheus+Grafana
Zipkin
Put all together
lArmeria - Spring, micrometer, zipkin integration
@Bean
ThriftServiceRegistrationBean service(MyService.AsyncIface myService,
Tracing tracing) {
return new ThriftServiceRegistrationBean()
.setPath("/thrift/")
.setService(
THttpService.of(shopCapabilityService)
.decorate(LoggingService.newDecorator())
.decorate(MetricCollectingService.newDecorator(
MeterIdFunction.ofDefault("LineShopService")))
.decorate(HttpTracingService.newDecorator(tracing))));
}
Thank you

More Related Content

What's hot

Spring Boot 1.3 News #渋谷Java
Spring Boot 1.3 News #渋谷JavaSpring Boot 1.3 News #渋谷Java
Spring Boot 1.3 News #渋谷JavaToshiaki Maki
 
Composable and streamable Play apps
Composable and streamable Play appsComposable and streamable Play apps
Composable and streamable Play appsYevgeniy Brikman
 
Gruntwork Executive Summary
Gruntwork Executive SummaryGruntwork Executive Summary
Gruntwork Executive SummaryYevgeniy Brikman
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with SpringJoshua Long
 
BOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyoBOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyoToshiaki Maki
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Yevgeniy Brikman
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務Mu Chun Wang
 
The Past Year in Spring for Apache Geode
The Past Year in Spring for Apache GeodeThe Past Year in Spring for Apache Geode
The Past Year in Spring for Apache GeodeVMware Tanzu
 
Dropwizard and Friends
Dropwizard and FriendsDropwizard and Friends
Dropwizard and FriendsYun Zhi Lin
 
Django Rest Framework - tips & trick
Django Rest Framework - tips & trick Django Rest Framework - tips & trick
Django Rest Framework - tips & trick Luca Zacchetti
 
Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments Pavel Kaminsky
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot IntroductionJeevesh Pandey
 
Spring boot入門ハンズオン第二回
Spring boot入門ハンズオン第二回Spring boot入門ハンズオン第二回
Spring boot入門ハンズオン第二回haruki ueno
 
Building an API with Django and Django REST Framework
Building an API with Django and Django REST FrameworkBuilding an API with Django and Django REST Framework
Building an API with Django and Django REST FrameworkChristopher Foresman
 
the Spring 4 update
the Spring 4 updatethe Spring 4 update
the Spring 4 updateJoshua Long
 
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015Matt Raible
 
Combining Django REST framework & Elasticsearch
Combining Django REST framework & ElasticsearchCombining Django REST framework & Elasticsearch
Combining Django REST framework & ElasticsearchYaroslav Muravskyi
 
DAST в CI/CD, Ольга Свиридова
DAST в CI/CD, Ольга СвиридоваDAST в CI/CD, Ольга Свиридова
DAST в CI/CD, Ольга СвиридоваMail.ru Group
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンharuki ueno
 

What's hot (20)

Spring Boot 1.3 News #渋谷Java
Spring Boot 1.3 News #渋谷JavaSpring Boot 1.3 News #渋谷Java
Spring Boot 1.3 News #渋谷Java
 
Composable and streamable Play apps
Composable and streamable Play appsComposable and streamable Play apps
Composable and streamable Play apps
 
Gruntwork Executive Summary
Gruntwork Executive SummaryGruntwork Executive Summary
Gruntwork Executive Summary
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
BOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyoBOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyo
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
 
The Past Year in Spring for Apache Geode
The Past Year in Spring for Apache GeodeThe Past Year in Spring for Apache Geode
The Past Year in Spring for Apache Geode
 
Dropwizard and Friends
Dropwizard and FriendsDropwizard and Friends
Dropwizard and Friends
 
Django Rest Framework - tips & trick
Django Rest Framework - tips & trick Django Rest Framework - tips & trick
Django Rest Framework - tips & trick
 
Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
Spring boot入門ハンズオン第二回
Spring boot入門ハンズオン第二回Spring boot入門ハンズオン第二回
Spring boot入門ハンズオン第二回
 
Building an API with Django and Django REST Framework
Building an API with Django and Django REST FrameworkBuilding an API with Django and Django REST Framework
Building an API with Django and Django REST Framework
 
the Spring 4 update
the Spring 4 updatethe Spring 4 update
the Spring 4 update
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
 
Combining Django REST framework & Elasticsearch
Combining Django REST framework & ElasticsearchCombining Django REST framework & Elasticsearch
Combining Django REST framework & Elasticsearch
 
DAST в CI/CD, Ольга Свиридова
DAST в CI/CD, Ольга СвиридоваDAST в CI/CD, Ольга Свиридова
DAST в CI/CD, Ольга Свиридова
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオン
 

Similar to 2017年のLINEのマイクロサービスを支えるSpring

Lambda Architecture Using SQL
Lambda Architecture Using SQLLambda Architecture Using SQL
Lambda Architecture Using SQLSATOSHI TAGOMORI
 
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...François-Guillaume Ribreau
 
The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...Karthik Murugesan
 
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyUsing Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyLaunchAny
 
Jena University Talk 2016.03.09 -- SQL at Zalando Technology
Jena University Talk 2016.03.09 -- SQL at Zalando TechnologyJena University Talk 2016.03.09 -- SQL at Zalando Technology
Jena University Talk 2016.03.09 -- SQL at Zalando TechnologyValentine Gogichashvili
 
Motion Django Meetup
Motion Django MeetupMotion Django Meetup
Motion Django MeetupMike Malone
 
re:Invent Deep Dive on Lambda Layers and Runtime API
re:Invent Deep Dive on Lambda Layers and Runtime APIre:Invent Deep Dive on Lambda Layers and Runtime API
re:Invent Deep Dive on Lambda Layers and Runtime APIAmazon Web Services
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011Lance Ball
 
Rapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and PythonRapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and PythonRick Copeland
 
Web program-peformance-optimization
Web program-peformance-optimizationWeb program-peformance-optimization
Web program-peformance-optimizationxiaojueqq12345
 
Visualizing Big Data in Realtime
Visualizing Big Data in RealtimeVisualizing Big Data in Realtime
Visualizing Big Data in RealtimeDataWorks Summit
 
Cloud native programming model comparison
Cloud native programming model comparisonCloud native programming model comparison
Cloud native programming model comparisonEmily Jiang
 
Practices and tools for building better APIs
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIsNLJUG
 
Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Peter Hendriks
 
Legacy java ee meet lambda
Legacy java ee  meet lambdaLegacy java ee  meet lambda
Legacy java ee meet lambdaKim Kao
 
Monitoring Spark Applications
Monitoring Spark ApplicationsMonitoring Spark Applications
Monitoring Spark ApplicationsTzach Zohar
 
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...Oracle Developers
 
Sinatra and JSONQuery Web Service
Sinatra and JSONQuery Web ServiceSinatra and JSONQuery Web Service
Sinatra and JSONQuery Web Servicevvatikiotis
 
Stream Processing use cases and applications with Apache Apex by Thomas Weise
Stream Processing use cases and applications with Apache Apex by Thomas WeiseStream Processing use cases and applications with Apache Apex by Thomas Weise
Stream Processing use cases and applications with Apache Apex by Thomas WeiseBig Data Spain
 
Building Serverless applications with Python
Building Serverless applications with PythonBuilding Serverless applications with Python
Building Serverless applications with PythonAndrii Soldatenko
 

Similar to 2017年のLINEのマイクロサービスを支えるSpring (20)

Lambda Architecture Using SQL
Lambda Architecture Using SQLLambda Architecture Using SQL
Lambda Architecture Using SQL
 
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
 
The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...
 
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyUsing Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in Ruby
 
Jena University Talk 2016.03.09 -- SQL at Zalando Technology
Jena University Talk 2016.03.09 -- SQL at Zalando TechnologyJena University Talk 2016.03.09 -- SQL at Zalando Technology
Jena University Talk 2016.03.09 -- SQL at Zalando Technology
 
Motion Django Meetup
Motion Django MeetupMotion Django Meetup
Motion Django Meetup
 
re:Invent Deep Dive on Lambda Layers and Runtime API
re:Invent Deep Dive on Lambda Layers and Runtime APIre:Invent Deep Dive on Lambda Layers and Runtime API
re:Invent Deep Dive on Lambda Layers and Runtime API
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011
 
Rapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and PythonRapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and Python
 
Web program-peformance-optimization
Web program-peformance-optimizationWeb program-peformance-optimization
Web program-peformance-optimization
 
Visualizing Big Data in Realtime
Visualizing Big Data in RealtimeVisualizing Big Data in Realtime
Visualizing Big Data in Realtime
 
Cloud native programming model comparison
Cloud native programming model comparisonCloud native programming model comparison
Cloud native programming model comparison
 
Practices and tools for building better APIs
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIs
 
Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)
 
Legacy java ee meet lambda
Legacy java ee  meet lambdaLegacy java ee  meet lambda
Legacy java ee meet lambda
 
Monitoring Spark Applications
Monitoring Spark ApplicationsMonitoring Spark Applications
Monitoring Spark Applications
 
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
 
Sinatra and JSONQuery Web Service
Sinatra and JSONQuery Web ServiceSinatra and JSONQuery Web Service
Sinatra and JSONQuery Web Service
 
Stream Processing use cases and applications with Apache Apex by Thomas Weise
Stream Processing use cases and applications with Apache Apex by Thomas WeiseStream Processing use cases and applications with Apache Apex by Thomas Weise
Stream Processing use cases and applications with Apache Apex by Thomas Weise
 
Building Serverless applications with Python
Building Serverless applications with PythonBuilding Serverless applications with Python
Building Serverless applications with Python
 

More from LINE Corporation

JJUG CCC 2018 Fall 懇親会LT
JJUG CCC 2018 Fall 懇親会LTJJUG CCC 2018 Fall 懇親会LT
JJUG CCC 2018 Fall 懇親会LTLINE Corporation
 
Reduce dependency on Rx with Kotlin Coroutines
Reduce dependency on Rx with Kotlin CoroutinesReduce dependency on Rx with Kotlin Coroutines
Reduce dependency on Rx with Kotlin CoroutinesLINE Corporation
 
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
Kotlin/NativeでAndroidのNativeメソッドを実装してみたKotlin/NativeでAndroidのNativeメソッドを実装してみた
Kotlin/NativeでAndroidのNativeメソッドを実装してみたLINE Corporation
 
Use Kotlin scripts and Clova SDK to build your Clova extension
Use Kotlin scripts and Clova SDK to build your Clova extensionUse Kotlin scripts and Clova SDK to build your Clova extension
Use Kotlin scripts and Clova SDK to build your Clova extensionLINE Corporation
 
The Magic of LINE 購物 Testing
The Magic of LINE 購物 TestingThe Magic of LINE 購物 Testing
The Magic of LINE 購物 TestingLINE Corporation
 
UI Automation Test with JUnit5
UI Automation Test with JUnit5UI Automation Test with JUnit5
UI Automation Test with JUnit5LINE Corporation
 
Feature Detection for UI Testing
Feature Detection for UI TestingFeature Detection for UI Testing
Feature Detection for UI TestingLINE Corporation
 
LINE 新星計劃介紹與新創團隊分享
LINE 新星計劃介紹與新創團隊分享LINE 新星計劃介紹與新創團隊分享
LINE 新星計劃介紹與新創團隊分享LINE Corporation
 
​LINE 技術合作夥伴與應用分享
​LINE 技術合作夥伴與應用分享​LINE 技術合作夥伴與應用分享
​LINE 技術合作夥伴與應用分享LINE Corporation
 
LINE 開發者社群經營與技術推廣
LINE 開發者社群經營與技術推廣LINE 開發者社群經營與技術推廣
LINE 開發者社群經營與技術推廣LINE Corporation
 
日本開發者大會短講分享
日本開發者大會短講分享日本開發者大會短講分享
日本開發者大會短講分享LINE Corporation
 
LINE Chatbot - 活動報名報到設計分享
LINE Chatbot - 活動報名報到設計分享LINE Chatbot - 活動報名報到設計分享
LINE Chatbot - 活動報名報到設計分享LINE Corporation
 
在 LINE 私有雲中使用 Managed Kubernetes
在 LINE 私有雲中使用 Managed Kubernetes在 LINE 私有雲中使用 Managed Kubernetes
在 LINE 私有雲中使用 Managed KubernetesLINE Corporation
 
LINE TODAY高效率的敏捷測試開發技巧
LINE TODAY高效率的敏捷測試開發技巧LINE TODAY高效率的敏捷測試開發技巧
LINE TODAY高效率的敏捷測試開發技巧LINE Corporation
 
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹LINE Corporation
 
LINE Things - LINE IoT平台新技術分享
LINE Things - LINE IoT平台新技術分享LINE Things - LINE IoT平台新技術分享
LINE Things - LINE IoT平台新技術分享LINE Corporation
 
LINE Pay - 一卡通支付新體驗
LINE Pay - 一卡通支付新體驗LINE Pay - 一卡通支付新體驗
LINE Pay - 一卡通支付新體驗LINE Corporation
 
LINE Platform API Update - 打造一個更好的Chatbot服務
LINE Platform API Update - 打造一個更好的Chatbot服務LINE Platform API Update - 打造一個更好的Chatbot服務
LINE Platform API Update - 打造一個更好的Chatbot服務LINE Corporation
 
Keynote - ​LINE 的技術策略佈局與跨國產品開發
Keynote - ​LINE 的技術策略佈局與跨國產品開發Keynote - ​LINE 的技術策略佈局與跨國產品開發
Keynote - ​LINE 的技術策略佈局與跨國產品開發LINE Corporation
 

More from LINE Corporation (20)

JJUG CCC 2018 Fall 懇親会LT
JJUG CCC 2018 Fall 懇親会LTJJUG CCC 2018 Fall 懇親会LT
JJUG CCC 2018 Fall 懇親会LT
 
Reduce dependency on Rx with Kotlin Coroutines
Reduce dependency on Rx with Kotlin CoroutinesReduce dependency on Rx with Kotlin Coroutines
Reduce dependency on Rx with Kotlin Coroutines
 
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
Kotlin/NativeでAndroidのNativeメソッドを実装してみたKotlin/NativeでAndroidのNativeメソッドを実装してみた
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
 
Use Kotlin scripts and Clova SDK to build your Clova extension
Use Kotlin scripts and Clova SDK to build your Clova extensionUse Kotlin scripts and Clova SDK to build your Clova extension
Use Kotlin scripts and Clova SDK to build your Clova extension
 
The Magic of LINE 購物 Testing
The Magic of LINE 購物 TestingThe Magic of LINE 購物 Testing
The Magic of LINE 購物 Testing
 
GA Test Automation
GA Test AutomationGA Test Automation
GA Test Automation
 
UI Automation Test with JUnit5
UI Automation Test with JUnit5UI Automation Test with JUnit5
UI Automation Test with JUnit5
 
Feature Detection for UI Testing
Feature Detection for UI TestingFeature Detection for UI Testing
Feature Detection for UI Testing
 
LINE 新星計劃介紹與新創團隊分享
LINE 新星計劃介紹與新創團隊分享LINE 新星計劃介紹與新創團隊分享
LINE 新星計劃介紹與新創團隊分享
 
​LINE 技術合作夥伴與應用分享
​LINE 技術合作夥伴與應用分享​LINE 技術合作夥伴與應用分享
​LINE 技術合作夥伴與應用分享
 
LINE 開發者社群經營與技術推廣
LINE 開發者社群經營與技術推廣LINE 開發者社群經營與技術推廣
LINE 開發者社群經營與技術推廣
 
日本開發者大會短講分享
日本開發者大會短講分享日本開發者大會短講分享
日本開發者大會短講分享
 
LINE Chatbot - 活動報名報到設計分享
LINE Chatbot - 活動報名報到設計分享LINE Chatbot - 活動報名報到設計分享
LINE Chatbot - 活動報名報到設計分享
 
在 LINE 私有雲中使用 Managed Kubernetes
在 LINE 私有雲中使用 Managed Kubernetes在 LINE 私有雲中使用 Managed Kubernetes
在 LINE 私有雲中使用 Managed Kubernetes
 
LINE TODAY高效率的敏捷測試開發技巧
LINE TODAY高效率的敏捷測試開發技巧LINE TODAY高效率的敏捷測試開發技巧
LINE TODAY高效率的敏捷測試開發技巧
 
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
 
LINE Things - LINE IoT平台新技術分享
LINE Things - LINE IoT平台新技術分享LINE Things - LINE IoT平台新技術分享
LINE Things - LINE IoT平台新技術分享
 
LINE Pay - 一卡通支付新體驗
LINE Pay - 一卡通支付新體驗LINE Pay - 一卡通支付新體驗
LINE Pay - 一卡通支付新體驗
 
LINE Platform API Update - 打造一個更好的Chatbot服務
LINE Platform API Update - 打造一個更好的Chatbot服務LINE Platform API Update - 打造一個更好的Chatbot服務
LINE Platform API Update - 打造一個更好的Chatbot服務
 
Keynote - ​LINE 的技術策略佈局與跨國產品開發
Keynote - ​LINE 的技術策略佈局與跨國產品開發Keynote - ​LINE 的技術策略佈局與跨國產品開發
Keynote - ​LINE 的技術策略佈局與跨國產品開發
 

Recently uploaded

Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxMasterG
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...SOFTTECHHUB
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistandanishmna97
 
Navigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiNavigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiRaviKumarDaparthi
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfAnubhavMangla3
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 

Recently uploaded (20)

Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistan
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Navigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiNavigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi Daparthi
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 

2017年のLINEのマイクロサービスを支えるSpring

  • 2. @imasahiro https://github.com/imasahiro Self Intro l Masahiro Ide l Server side engineer at LINE l Mainly worked on スタンプ/着せかえ ショップ l Contribute to Armeria - Asynchronous RPC/REST library l https://github.com/line/armeria
  • 3. • Where is Spring used at LINE? • Useful/Customized Spring features • Monitoring Agenda
  • 5. LINE System l LINE has hundreds of applications l Recent apps are Java/Spring applications l Mainly communicates with Thrift, and REST l Uses same in-house deployment, monitoring system
  • 7. スタンプショップ l Spring-boot 1.5.8, Spring-MVC l Mostly Asynchronous Http/2 Thrift/REST service l Java8, RxJava2, (Completable|Listenable)Future l Storage l Redis, MySQL, Mongo, ElasticSearch l Monitoring l Micrometer, Dropwizard Metrics, Prometheus, Zipkin
  • 8. Sticker server Mongo MySQL ElasticSearch Redis LINE Client Theme server Search server STORE Server スタンプショップ 構成
  • 9. スタンプショップ l Spring-boot 1.5.8, Spring-MVC l Mostly Asynchronous Http/2 Thrift/REST service l Java8, RxJava2, (Completable|Listenable)Future l Storage l Redis, MySQL, Mongo, ElasticSearch l Monitoring l Micrometer, Dropwizard Metrics, Prometheus, Zipkin
  • 10. l Easy to setup l Have many integrations with other libraries l Mybatis, Thymeleaf, Tomcat, etc. Why spring, why spring-boot? @SpringBootApplication public class SampleApp { @Configuration class MvcConf extends WebMvcConfigurerAdapter {…} public static void main(String[] args) { SpringApplication.run(SampleApp.class, args); } }
  • 11. Simple & Useful Spring features 1. Spring cache abstraction 1. (Spring) AOP 2. Dependency management
  • 12. 1. Spring Cache Abstraction l SpringにおけるCacheの抽象化 l Can choose cache implementation l Redis, Caffeine, Guava, etc. l …But need to use carefully on async service @Cacheable(cacheNames = "listCache") List<Item> selectByLang(String lang) { return sqlSession.selectList(…); }
  • 13. Async support in cache abstraction lNaive (and wrong) solution l This just caches a Future… l But donʼt cache value in Future l See https://jira.spring.io/browse/SPR-12967 @Cacheable(cacheNames = "listCache") CompletableFuture<List<Item>> selectByLang(String lang) { return CompletableFuture.supplyAsync( () -> sqlSession.selectList(…), executor); }
  • 14. Async support in cache abstraction lMade similar cache abstraction l with Caffeine AsyncLoadingCache and Lettuce (Async redis client) @AsyncCacheable(cacheNames = "listCache") CompletableFuture<List<Item>> selectByLang(String lang) { return CompletableFuture.supplyAsync( () -> sqlSession.selectList(…), executor); }
  • 15. Simple & Useful Spring features 1. Spring cache abstraction 1. (Spring) AOP 2. Dependency management
  • 16. 2. (Spring) AOP lAOP - Aspect Oriented Programming l Use case: logging, perf instrumentation @Loggable @GetMapping(“/”) ModelAndView home(…) {…} @Around("@annotation(Loggable)") public Object logging(ProceedingJoinPoint pjp) { Timer timer = newTimer() try { return pjp.proceed(); } finally { long latency = timer.stop(); logger.info(“request path: {}, args:{}, latency:{}”, …, latency)); } }
  • 17. Client side MySQL sharding using AOP ApplicationApplication MySQL Slave MySQL Master Shard01 MySQL Slave MySQL Master Shard01 MySQL Slave MySQL Master Shard01 @Shardable List<Item> selectListByUserId(int id) {…} List<DataSource> dataSources = …; @Around("@annotation(Shardable)") Object sharding(ProceedingJoinPoint pjp) { int id = getArguments(pjp)[0]; source = dataSrouces.get(id % 12); useDataSource(source); return pjp.proceed(); }
  • 18. 3. Dependency management lBOM and Dependency management plugin lSpringがlibrary versionを管理してくれる dependencyManagement { imports { mavenBom 'io.spring.platform:platform-bom:Brussels-SR5' } dependencies { dependencySet(group: 'com.linecorp.armeria', version: '0.55.0') { entry 'armeria-tomcat-shaded’ entry 'armeria-thrift0.9-shaded' } dependency 'biz.paluch.redis:lettuce:4.4.1.Final’ … }}
  • 19. スタンプショップ l Spring-boot 1.5.8, Spring-MVC l Mostly Asynchronous Http/2 Thrift/REST service l Java8, RxJava2, (Completable|Listenable)Future l Storage l Redis, MySQL, Mongo, ElasticSearch l Monitoring l Micrometer, Dropwizard Metrics, Prometheus, Zipkin
  • 20. How to make a service asynchronous? l元々はTomcat+Spring MVC or thrift+DBなシステム @Repository public class ShopStorage { List<Item> selectByLang(String lang) { return sqlSession.selectList( “shop.selectByLang”, lang); }} @Controller public class ShopController { @ResponseBody List<Item> home() { return storage.getList(); }}
  • 21. How to make a service asynchronous? lSync accessを1つずつAsyncに書き直す @Repository public class ShopStorage { List<Item> selectByLang(String lang) { return sqlSession.selectList( “shop.selectByLang”, lang); }} @Controller public class ShopController { @ResponseBody List<Item> home() { return storage.getList(); }} @Repository public class AsyncShopStorage { CompletableFuture<List<Item>> selectByLang(String lang) { return CompletableFuture.supplyAsync( () -> sqlSession.selectList( “shop.selectByLang”, lang), executor); }} @Controller public class AsyncShopController { @ResponseBody DeferredResult<List<Item>> home() { result = new DeferredResult<>(); storage.getList() .thenApply(result::setResult); return result; }}
  • 22. • Where is Spring used at LINE? • Useful/Customized Spring features • Monitoring Agenda
  • 23. How to observe our services? lLog l その瞬間に何が起こったかを確認する lMetric l 現在起きている現象のトレンドを確認する lTrace l システム間で何が何が起きているかを確認する
  • 24. How to observe our services? lLog l Slf4j + Kibana lMetric l Micormeter, Prometheus, Dropwizard metrics l Grafana lTrace l Zipkin l io.zipkin.brave:brave-instrumentation-mysql l io.zipkin.brave:brave-instrumentation-spring-webmvc l And elasticsearch, mongo, redis integrations, etc.
  • 25. Micrometer l Supports multiple monitoring tools l Dropwizard Metrics, Prometheus, etc. l Will be provide as a Spring Boot 2.0 metrics collection l Already used in production servers l Found some concurrency issues but now looks stable l https://github.com/micrometer-metrics/micrometer/issues/139 l https://github.com/micrometer-metrics/micrometer/issues/172 l https://github.com/micrometer-metrics/micrometer/issues/208
  • 26. Prometheus lSimple TSDB, Pull型 lSupports querying, alerting Application # HELP armeria_client_response_duration_seconds # TYPE armeria_client_response_duration_seconds summary armeria_client_response_duration_seconds{method="sendMessage", service=”Service",quantile="0.5",} 8.194E-4 armeria_client_response_duration_seconds{method="sendMessage", service=”Service",quantile="0.75",} 9.494E-4 armeria_client_response_duration_seconds{method="sendMessage", service=”Service",quantile="0.90",} 9.994E-4 … /internal/metrics Node exporterPrometheus pull ApplicationNode exporter
  • 29. Put all together lArmeria - Spring, micrometer, zipkin integration @Bean ThriftServiceRegistrationBean service(MyService.AsyncIface myService, Tracing tracing) { return new ThriftServiceRegistrationBean() .setPath("/thrift/") .setService( THttpService.of(shopCapabilityService) .decorate(LoggingService.newDecorator()) .decorate(MetricCollectingService.newDecorator( MeterIdFunction.ofDefault("LineShopService"))) .decorate(HttpTracingService.newDecorator(tracing)))); }