blob: 38ba2b6f668d3a06c5d0ff78fb2510c16c6c6ff8 [file] [log] [blame]
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="prev" href="../visit-sc/">
<link rel="next" href="../microservice-invocation-chain/">
<link rel="icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.0, mkdocs-material-9.5.19">
<title>Metrics - ServiceComb Java Chassis Developers Guide</title>
<link rel="stylesheet" href="../../assets/stylesheets/main.66ac8b77.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#first-the-introduction-of-metrics" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../.." title="ServiceComb Java Chassis Developers Guide" class="md-header__button md-logo" aria-label="ServiceComb Java Chassis Developers Guide" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
ServiceComb Java Chassis Developers Guide
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Metrics
</span>
</div>
</div>
</div>
<script>var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
</button>
</nav>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="ServiceComb Java Chassis Developers Guide" class="md-nav__button md-logo" aria-label="ServiceComb Java Chassis Developers Guide" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
</a>
ServiceComb Java Chassis Developers Guide
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../.." class="md-nav__link">
<span class="md-ellipsis">
Introduction
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
<span class="md-ellipsis">
Getting Started
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Getting Started
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../start/terminology/" class="md-nav__link">
<span class="md-ellipsis">
Glossary
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../start/architecture/" class="md-nav__link">
<span class="md-ellipsis">
Architecture
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../start/development-environment/" class="md-nav__link">
<span class="md-ellipsis">
Development environment
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../start/first-sample/" class="md-nav__link">
<span class="md-ellipsis">
Develop the first microservice
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
<label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="0">
<span class="md-ellipsis">
Development Service Provider
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Development Service Provider
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../build-provider/definition/service-definition/" class="md-nav__link">
<span class="md-ellipsis">
Service definition
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/define-contract/" class="md-nav__link">
<span class="md-ellipsis">
Service contract definition
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/code-first/" class="md-nav__link">
<span class="md-ellipsis">
Implicit API definition
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/swagger-annotation/" class="md-nav__link">
<span class="md-ellipsis">
Use Swagger annotations
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/springmvc/" class="md-nav__link">
<span class="md-ellipsis">
Develop with SpringMVC
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/jaxrs/" class="md-nav__link">
<span class="md-ellipsis">
Develop with JAX-RS
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/transparent-rpc/" class="md-nav__link">
<span class="md-ellipsis">
Develop with Transparent RPC
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/interface-constraints/" class="md-nav__link">
<span class="md-ellipsis">
Interface definition and data type
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/listen-address-and-publish-address/" class="md-nav__link">
<span class="md-ellipsis">
Service listening address and publishing address
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/thread-pool/" class="md-nav__link">
<span class="md-ellipsis">
Thread pool
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_11" >
<label class="md-nav__link" for="__nav_3_11" id="__nav_3_11_label" tabindex="0">
<span class="md-ellipsis">
Service Configuration
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_11_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_11">
<span class="md-nav__icon md-icon"></span>
Service Configuration
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../build-provider/configuration/ratelimite-strategy/" class="md-nav__link">
<span class="md-ellipsis">
Rate Limiting Policy
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/configuration/parameter-validator/" class="md-nav__link">
<span class="md-ellipsis">
Parameter Validator
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../../build-provider/bootup/" class="md-nav__link">
<span class="md-ellipsis">
Boot-up Process
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/access-log-configuration/" class="md-nav__link">
<span class="md-ellipsis">
Access Log Configuration
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" >
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0">
<span class="md-ellipsis">
Writing Service Consumer
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Writing Service Consumer
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../build-consumer/common-configuration/" class="md-nav__link">
<span class="md-ellipsis">
Consumer common configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-consumer/using-resttemplate/" class="md-nav__link">
<span class="md-ellipsis">
Using Rest Template
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-consumer/using-AsyncRestTemplate/" class="md-nav__link">
<span class="md-ellipsis">
Using AsyncRestTemplate
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-consumer/develop-consumer-using-rpc/" class="md-nav__link">
<span class="md-ellipsis">
Using with RPC
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-consumer/with-contract/" class="md-nav__link">
<span class="md-ellipsis">
Contract
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4_6" >
<label class="md-nav__link" for="__nav_4_6" id="__nav_4_6_label" tabindex="0">
<span class="md-ellipsis">
Invoke control
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_4_6_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4_6">
<span class="md-nav__icon md-icon"></span>
Invoke control
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../build-consumer/flow-control/" class="md-nav__link">
<span class="md-ellipsis">
Flow Control
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-consumer/fault-injection/" class="md-nav__link">
<span class="md-ellipsis">
Fault Injection
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../../build-consumer/3rd-party-service-invoke/" class="md-nav__link">
<span class="md-ellipsis">
Invoke 3rd-party REST services
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
<span class="md-ellipsis">
Transports
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Transports
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../transports/rest-over-servlet/" class="md-nav__link">
<span class="md-ellipsis">
REST over Servlet
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../transports/rest-over-vertx/" class="md-nav__link">
<span class="md-ellipsis">
REST over Vertx
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../transports/highway-rpc/" class="md-nav__link">
<span class="md-ellipsis">
Highway
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../transports/http2/" class="md-nav__link">
<span class="md-ellipsis">
HTTP2
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" checked>
<label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
<span class="md-ellipsis">
General Development
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
General Development
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../visit-sc/" class="md-nav__link">
<span class="md-ellipsis">
Access Service Center
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
Metrics
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../microservice-invocation-chain/" class="md-nav__link">
<span class="md-ellipsis">
Microservice invocation chain
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../customized-tracing/" class="md-nav__link">
<span class="md-ellipsis">
Customized-Tracing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../local-develop-test/" class="md-nav__link">
<span class="md-ellipsis">
Local development and testing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../http-filter/" class="md-nav__link">
<span class="md-ellipsis">
Http Filter
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../file-upload/" class="md-nav__link">
<span class="md-ellipsis">
File Uploading
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../file-download/" class="md-nav__link">
<span class="md-ellipsis">
File Downloading
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../reactive/" class="md-nav__link">
<span class="md-ellipsis">
Reactive Programing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../dnsconfig/" class="md-nav__link">
<span class="md-ellipsis">
DNS Custom Configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../dai-li-she-zhi/" class="md-nav__link">
<span class="md-ellipsis">
Proxy Settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../report-framework-version/" class="md-nav__link">
<span class="md-ellipsis">
Report framework version
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../cross-app-invocation/" class="md-nav__link">
<span class="md-ellipsis">
Cross-application invocation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../secret-field/" class="md-nav__link">
<span class="md-ellipsis">
Customized serialization and deserialization
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../context/" class="md-nav__link">
<span class="md-ellipsis">
Using Context to pass control messages
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../produceprocess/" class="md-nav__link">
<span class="md-ellipsis">
Return value serialization extension
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../CORS/" class="md-nav__link">
<span class="md-ellipsis">
CORS mechanism
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../AlarmEvent/" class="md-nav__link">
<span class="md-ellipsis">
Get fuse and instance isolation alarm event information
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../shutdown/" class="md-nav__link">
<span class="md-ellipsis">
Shutdown gracefully
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../error-handling/" class="md-nav__link">
<span class="md-ellipsis">
Handling exceptions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../multienvironment/" class="md-nav__link">
<span class="md-ellipsis">
Multi-environment isolation between microservice instances
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../thread-model/" class="md-nav__link">
<span class="md-ellipsis">
Thread Model
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" >
<label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
<span class="md-ellipsis">
Configuration
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
Configuration
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../config/general-config/" class="md-nav__link">
<span class="md-ellipsis">
General config
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../config/inject-config/" class="md-nav__link">
<span class="md-ellipsis">
Configuration injection
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8" >
<label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
<span class="md-ellipsis">
Service Capability Open
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
Service Capability Open
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../edge/open-service/" class="md-nav__link">
<span class="md-ellipsis">
Intruductions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../edge/by-servicecomb-sdk/" class="md-nav__link">
<span class="md-ellipsis">
Using Edge Service
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../edge/nginx/" class="md-nav__link">
<span class="md-ellipsis">
Using confd and Nginx as edge services
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../edge/zuul/" class="md-nav__link">
<span class="md-ellipsis">
Use zuul as edge services
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_9" >
<label class="md-nav__link" for="__nav_9" id="__nav_9_label" tabindex="0">
<span class="md-ellipsis">
Service Packing and Running
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_9">
<span class="md-nav__icon md-icon"></span>
Service Packing and Running
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../packaging/standalone/" class="md-nav__link">
<span class="md-ellipsis">
Standalone mode
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../packaging/web-container/" class="md-nav__link">
<span class="md-ellipsis">
WEB container mode
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_10" >
<label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
<span class="md-ellipsis">
Micro Service Security
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_10">
<span class="md-nav__icon md-icon"></span>
Micro Service Security
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../security/tls/" class="md-nav__link">
<span class="md-ellipsis">
Using TLS
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../security/rsa/" class="md-nav__link">
<span class="md-ellipsis">
Using RSA certification
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_11" >
<label class="md-nav__link" for="__nav_11" id="__nav_11_label" tabindex="0">
<span class="md-ellipsis">
Using java chassis in Spring Boot
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_11_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_11">
<span class="md-nav__icon md-icon"></span>
Using java chassis in Spring Boot
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../using-java-chassis-in-spring-boot/using-java-chassis-in-spring-boot/" class="md-nav__link">
<span class="md-ellipsis">
Intruductions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../using-java-chassis-in-spring-boot/components-for-spring-boot/" class="md-nav__link">
<span class="md-ellipsis">
spring boot starter for java-chassis
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../using-java-chassis-in-spring-boot/java-application/" class="md-nav__link">
<span class="md-ellipsis">
JAVA application development
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../using-java-chassis-in-spring-boot/web-application/" class="md-nav__link">
<span class="md-ellipsis">
Web development method development
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../using-java-chassis-in-spring-boot/diff-between-java-web/" class="md-nav__link">
<span class="md-ellipsis">
The difference between JAVA application method and Web development method
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../using-java-chassis-in-spring-boot/diff-spring-mvc/" class="md-nav__link">
<span class="md-ellipsis">
The difference in Spring MVC mode
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_12" >
<label class="md-nav__link" for="__nav_12" id="__nav_12_label" tabindex="0">
<span class="md-ellipsis">
Handlers reference
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_12_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_12">
<span class="md-nav__icon md-icon"></span>
Handlers reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../references-handlers/intruduction/" class="md-nav__link">
<span class="md-ellipsis">
Intruductions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../references-handlers/loadbalance/" class="md-nav__link">
<span class="md-ellipsis">
Load Balancing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../references-handlers/publickey/" class="md-nav__link">
<span class="md-ellipsis">
Public key authentication
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_13" >
<label class="md-nav__link" for="__nav_13" id="__nav_13_label" tabindex="0">
<span class="md-ellipsis">
FAQ
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_13_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_13">
<span class="md-nav__icon md-icon"></span>
FAQ
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../question-and-answer/question_answer/" class="md-nav__link">
<span class="md-ellipsis">
Q & A
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../question-and-answer/faq/" class="md-nav__link">
<span class="md-ellipsis">
FAQ
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../question-and-answer/interface-compatibility/" class="md-nav__link">
<span class="md-ellipsis">
Micro Service Interface Compatibility FAQ
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="first-the-introduction-of-metrics">First, the introduction of Metrics</h1>
<p><img alt="" src="../../assets/metrics/logicDiagram.png" /></p>
<ol>
<li>Based on <a href="https://github.com/Netflix/spectator">netflix spectator</a></li>
<li>Foundation-metrics loads all MetricsInitializer implementations via the SPI mechanism. Implementers can use the getOrder in the MetricsInitializer to plan the execution order. The smaller the order number, the earlier it will be executed.</li>
<li>Metrics-core implements 3 types of MetricsInitializer:</li>
<li>DefaultRegistryInitializer: Instantiate and register spectator-reg-servo, set a smaller order, and ensure that it is executed before the following two types of MetricsInitializer</li>
<li>Meters Initializer: Statistics of data such as TPS, delay, thread pool, jvm resources, etc.</li>
<li>Publisher: Output statistics, built-in log output, and output via RESTful interface</li>
<li>Metrics-prometheus provides the ability to interface with prometheus</li>
</ol>
<h1 id="second-how-to-use">Second, how to use.</h1>
<h3 id="1maven-dependence">1.Maven dependence.</h3>
<pre><code>&lt;dependency&gt;
&lt;groupId&gt;org.apache.servicecomb&lt;/groupId&gt;
&lt;artifactId&gt;metrics-core&lt;/artifactId&gt;
&lt;/dependency&gt;
</code></pre>
<p>If integrate with prometheus, also need to add dependencies.</p>
<pre><code>&lt;dependency&gt;
&lt;groupId&gt;org.apache.servicecomb&lt;/groupId&gt;
&lt;artifactId&gt;metrics-prometheus&lt;/artifactId&gt;
&lt;/dependency&gt;
</code></pre>
<p><em>Note: Please change the version field to the actual version number; if the version number has been declared in the dependencyManagement, then you do not have to write the version number here</em></p>
<h3 id="2-configuration-instructions">2. Configuration instructions</h3>
<div class="metrics-cfg"></div>
<table>
<thead>
<tr>
<th style="text-align: left;">Configuration Item</th>
<th style="text-align: left;">Default</th>
<th style="text-align: left;">Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">servicecomb.metrics.window_time</td>
<td style="text-align: left;">60000</td>
<td style="text-align: left;">Statistical period, in milliseconds<br>TPS, delay, etc. Periodic data, updated once per cycle, the value obtained in the cycle, actually the value of the previous cycle</td>
</tr>
<tr>
<td style="text-align: left;">servicecomb.metrics<br>.invocation.latencyDistribution</td>
<td style="text-align: left;"></td>
<td style="text-align: left;">The latency distribution time period definition in milliseconds<br>for example:0,1,10,100,1000<br>indicates that the following latency scopes are defined: [0, 1),[1, 10),[10, 100),[100, 1000),[1000, )</td>
</tr>
<tr>
<td style="text-align: left;">servicecomb.metrics<br>.Consumer.invocation.slow.enabled</td>
<td style="text-align: left;">false</td>
<td style="text-align: left;">Whether to enable slow call detection on the Consumer side<br>Level 4 priority definitions can be supported by adding the suffix .${service}.${schema}.${operation}</td>
</tr>
<tr>
<td style="text-align: left;">servicecomb.metrics<br>.Consumer.invocation.slow.msTime</td>
<td style="text-align: left;">1000</td>
<td style="text-align: left;">If the latency exceeds the configured value, the log will be output immediately, and the time consumption information of the stage called this time will be recorded.<br>Level 4 priority definitions can be supported by adding the suffix .${service}.${schema}.${operation}</td>
</tr>
<tr>
<td style="text-align: left;">servicecomb.metrics<br>.Provider.invocation.slow.enabled</td>
<td style="text-align: left;">false</td>
<td style="text-align: left;">Whether to enable slow call detection on the Provider side<br>Level 4 priority definitions can be supported by adding the suffix .${service}.${schema}.${operation}</td>
</tr>
<tr>
<td style="text-align: left;">servicecomb.metrics<br>.Provider.invocation.slow.msTime</td>
<td style="text-align: left;">1000</td>
<td style="text-align: left;">If the latency exceeds the configured value, the log will be output immediately, and the time consumption information of the stage called this time will be recorded.<br>Level 4 priority definitions can be supported by adding the suffix .${service}.${schema}.${operation}</td>
</tr>
<tr>
<td style="text-align: left;">servicecomb.metrics<br>.prometheus.address</td>
<td style="text-align: left;">0.0.0.0:9696</td>
<td style="text-align: left;">prometheus listen address</td>
</tr>
<tr>
<td style="text-align: left;">servicecomb.metrics.publisher.defaultLog<br>.enabled</td>
<td style="text-align: left;">false</td>
<td style="text-align: left;">Whether to output the default statistics log</td>
</tr>
<tr>
<td style="text-align: left;">servicecomb.metrics.publisher.defaultLog<br>.endpoints.client.detail.enabled</td>
<td style="text-align: left;">false</td>
<td style="text-align: left;">Whether to output each client endpoint statistics log, because it is related to the target ip:port number, there may be a lot of data, so the default is not output</td>
</tr>
</tbody>
</table>
<h3 id="3-slow-call-detection">3. Slow call detection</h3>
<p>After slow call detection is enabled, if there is a slow call, the corresponding log will be output immediately:</p>
<pre><code>2019-04-02 23:01:09,103\[WARN]\[pool-7-thread-74]\[5ca37935c00ff2c7-350076] - slow(40 ms) invocation, CONSUMER highway perf1.impl.syncQuery
http method: GET
url : /v1/syncQuery/{id}/
server : highway://192.168.0.152:7070?login=true
status code: 200
total : 50.760 ms
prepare : 0.0 ms
handlers request : 0.0 ms
client filters request : 0.0 ms
send request : 0.5 ms
get connection : 0.0 ms
write to buf : 0.5 ms
wait response : 50.727 ms
wake consumer : 0.23 ms
client filters response: 0.2 ms
handlers response : 0.0 ms (SlowInvocationLogger.java:121)
</code></pre>
<p>Where 5ca37935c00ff2c7-350076 is the structure of ${traceId}-${invocationId}, referenced by %marker in the output format of log4j2 or logback</p>
<h3 id="4-access-via-restful">4. Access via RESTful</h3>
<p>As long as the microservices open the rest port, use a browser to access http://ip:port/metrics.
will get json data in the following format:</p>
<pre><code>{
&quot;servicecomb.vertx.endpoints(address=192.168.0.124:7070,statistic=connectCount,type=client)&quot;: 0.0,
&quot;servicecomb.vertx.endpoints(address=192.168.0.124:7070,statistic=disconnectCount,type=client)&quot;: 0.0,
&quot;servicecomb.vertx.endpoints(address=192.168.0.124:7070,statistic=connections,type=client)&quot;: 1.0,
&quot;servicecomb.vertx.endpoints(address=192.168.0.124:7070,statistic=bytesRead,type=client)&quot;: 508011.0,
&quot;servicecomb.vertx.endpoints(address=192.168.0.124:7070,statistic=bytesWritten,type=client)&quot;: 542163.0,
&quot;servicecomb.vertx.endpoints(address=192.168.0.124:7070,statistic=queueCount,type=client)&quot;: 0.0,
&quot;servicecomb.vertx.endpoints(address=0.0.0.0:7070,statistic=connectCount,type=server)&quot;: 0.0,
&quot;servicecomb.vertx.endpoints(address=0.0.0.0:7070,statistic=disconnectCount,type=server)&quot;: 0.0,
&quot;servicecomb.vertx.endpoints(address=0.0.0.0:7070,statistic=connections,type=server)&quot;: 1.0,
&quot;servicecomb.vertx.endpoints(address=0.0.0.0:7070,statistic=bytesRead,type=server)&quot;: 542163.0,
&quot;servicecomb.vertx.endpoints(address=0.0.0.0:7070,statistic=bytesWritten,type=server)&quot;: 508011.0,
&quot;servicecomb.vertx.endpoints(address=0.0.0.0:7070,statistic=rejectByConnectionLimit,type=server)&quot;: 0.0,
&quot;servicecomb.vertx.endpoints(address=localhost:8080,statistic=connectCount,type=server)&quot;: 0.0,
&quot;servicecomb.vertx.endpoints(address=localhost:8080,statistic=disconnectCount,type=server)&quot;: 0.0,
&quot;servicecomb.vertx.endpoints(address=localhost:8080,statistic=connections,type=server)&quot;: 0.0,
&quot;servicecomb.vertx.endpoints(address=localhost:8080,statistic=bytesRead,type=server)&quot;: 0.0,
&quot;servicecomb.vertx.endpoints(address=localhost:8080,statistic=bytesWritten,type=server)&quot;: 0.0,
&quot;servicecomb.vertx.endpoints(address=localhost:8080,statistic=rejectByConnectionLimit,type=server)&quot;: 0.0,
&quot;threadpool.completedTaskCount(id=cse.executor.groupThreadPool-group0)&quot;: 4320.0,
&quot;threadpool.rejectedCount(id=cse.executor.groupThreadPool-group0)&quot;: 0.0,
&quot;threadpool.taskCount(id=cse.executor.groupThreadPool-group0)&quot;: 4320.0,
&quot;threadpool.currentThreadsBusy(id=cse.executor.groupThreadPool-group0)&quot;: 0.0,
&quot;threadpool.poolSize(id=cse.executor.groupThreadPool-group0)&quot;: 4.0,
&quot;threadpool.maxThreads(id=cse.executor.groupThreadPool-group0)&quot;: 10.0,
&quot;threadpool.queueSize(id=cse.executor.groupThreadPool-group0)&quot;: 0.0,
&quot;threadpool.corePoolSize(id=cse.executor.groupThreadPool-group0)&quot;: 4.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,scope=[0,1),status=200,transport=highway,type=latencyDistribution)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,scope=[1,3),status=200,transport=highway,type=latencyDistribution)&quot;: 0.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,scope=[3,10),status=200,transport=highway,type=latencyDistribution)&quot;: 0.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,scope=[10,100),status=200,transport=highway,type=latencyDistribution)&quot;: 0.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,scope=[100,),status=200,transport=highway,type=latencyDistribution)&quot;: 0.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,scope=[0,1),status=200,transport=highway,type=latencyDistribution)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,scope=[1,3),status=200,transport=highway,type=latencyDistribution)&quot;: 0.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,scope=[3,10),status=200,transport=highway,type=latencyDistribution)&quot;: 0.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,scope=[10,100),status=200,transport=highway,type=latencyDistribution)&quot;: 0.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,scope=[100,),status=200,transport=highway,type=latencyDistribution)&quot;: 0.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=total,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=total,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.25269420000000004,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=total,statistic=max,status=200,transport=highway,type=stage)&quot;: 2.7110000000000003E-4,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=handlers_request,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=handlers_request,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.0079627,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=handlers_request,statistic=max,status=200,transport=highway,type=stage)&quot;: 1.74E-5,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=handlers_response,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=handlers_response,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.0060666,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=handlers_response,statistic=max,status=200,transport=highway,type=stage)&quot;: 1.08E-5,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=prepare,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=prepare,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.016679600000000003,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=prepare,statistic=max,status=200,transport=highway,type=stage)&quot;: 2.68E-5,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=queue,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=queue,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.08155480000000001,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=queue,statistic=max,status=200,transport=highway,type=stage)&quot;: 2.1470000000000001E-4,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=execution,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=execution,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.0098285,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=execution,statistic=max,status=200,transport=highway,type=stage)&quot;: 4.3100000000000004E-5,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=server_filters_request,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=server_filters_request,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.0170669,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=server_filters_request,statistic=max,status=200,transport=highway,type=stage)&quot;: 3.6400000000000004E-5,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=server_filters_response,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=server_filters_response,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.0196985,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=server_filters_response,statistic=max,status=200,transport=highway,type=stage)&quot;: 4.8100000000000004E-5,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=producer_send_response,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=producer_send_response,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.0880885,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=PRODUCER,stage=producer_send_response,statistic=max,status=200,transport=highway,type=stage)&quot;: 1.049E-4,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=total,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=total,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.9796976000000001,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=total,statistic=max,status=200,transport=highway,type=stage)&quot;: 6.720000000000001E-4,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=handlers_request,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=handlers_request,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.012601500000000002,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=handlers_request,statistic=max,status=200,transport=highway,type=stage)&quot;: 3.5000000000000004E-5,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=handlers_response,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=handlers_response,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.0066785,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=handlers_response,statistic=max,status=200,transport=highway,type=stage)&quot;: 3.21E-5,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=prepare,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=prepare,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.010363800000000001,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=prepare,statistic=max,status=200,transport=highway,type=stage)&quot;: 2.85E-5,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=client_filters_request,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=client_filters_request,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.0060282,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=client_filters_request,statistic=max,status=200,transport=highway,type=stage)&quot;: 9.2E-6,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_send_request,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_send_request,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.099984,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_send_request,statistic=max,status=200,transport=highway,type=stage)&quot;: 1.1740000000000001E-4,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_get_connection,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_get_connection,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.006916800000000001,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_get_connection,statistic=max,status=200,transport=highway,type=stage)&quot;: 5.83E-5,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_write_to_buf,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_write_to_buf,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.0930672,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_write_to_buf,statistic=max,status=200,transport=highway,type=stage)&quot;: 1.1580000000000001E-4,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_wait_response,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_wait_response,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.7654931,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_wait_response,statistic=max,status=200,transport=highway,type=stage)&quot;: 5.547E-4,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_wake_consumer,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_wake_consumer,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.0502085,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=consumer_wake_consumer,statistic=max,status=200,transport=highway,type=stage)&quot;: 3.7370000000000003E-4,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=client_filters_response,statistic=count,status=200,transport=highway,type=stage)&quot;: 4269.0,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=client_filters_response,statistic=totalTime,status=200,transport=highway,type=stage)&quot;: 0.0227188,
&quot;servicecomb.invocation(operation=perf1.impl.syncQuery,role=CONSUMER,stage=client_filters_response,statistic=max,status=200,transport=highway,type=stage)&quot;: 4.0E-5
}
</code></pre>
<h1 id="third-the-summary-of-statistical-items">Third, the summary of statistical items</h1>
<h3 id="1-cpu">1. CPU</h3>
<table class="metrics-table">
<tr>
<th>Name</th>
<th>Tag keys</th>
<th>Tag values</th>
<th>Description</th>
</tr>
<tr>
<td rowspan="2">os</td>
<td rowspan="2">type</td>
<td>cpu</td>
<td>System CPU usage in the current period, Solaris mode</td>
</tr>
<tr>
<td>processCpu</td>
<td>Microservice process CPU usage in the current period, IRIX mode<br>
processCpu divided by cpu is equal to the number of system CPUs</td>
</tr>
</table>
<h3 id="2-net">2. NET</h3>
<table class="metrics-table">
<tr>
<th>Name</th>
<th>Tag keys</th>
<th>Tag values</th>
<th>Description</th>
</tr>
<tr>
<td rowspan="6">os</td>
<td>type</td>
<td>net</td>
<td></td>
</tr>
<tr>
<td rowspan="4">statistic</td>
<td>send</td>
<td>Average number of bytes sent per second during the current period (Bps)</td>
</tr>
<tr>
<td>receive</td>
<td>Average number of bytes received per second during the current period (Bps)</td>
</tr>
<tr>
<td>sendPackets</td>
<td>Average number of packets sent per second (pps) during the current period</td>
</tr>
<tr>
<td>receivePackets</td>
<td>Average number of packets received per second (pps) during the current period</td>
</tr>
<tr>
<td>interface</td>
<td></td>
<td>net dev name</td>
</tr>
</table>
<h3 id="3-vertx-client-endpoints">3. vertx client endpoints</h3>
<table class="metrics-table">
<tr>
<th>Name</th>
<th>Tag keys</th>
<th>Tag values</th>
<th>Description</th>
</tr>
<tr>
<td rowspan="8">servicecomb<br>.vertx<br>.endpoints</td>
<td>type</td>
<td>client</td>
<td></td>
</tr>
<tr>
<td>address</td>
<td>${ip}:${port}</td>
<td>server ip:port</td>
</tr>
<tr>
<td rowspan="6">statistic</td>
<td>connectCount</td>
<td>Number of connections have been initiated in the current period</td>
</tr>
<tr>
<td>disconnectCount</td>
<td>Number of disconnections in the current period</td>
</tr>
<tr>
<td>queueCount</td>
<td>The number of requests in the http connection pool that are waiting to get a connection</td>
</tr>
<tr>
<td>connections</td>
<td>Current connection number</td>
</tr>
<tr>
<td>bytesRead</td>
<td>Average number of bytes received per second during the current period (Bps)<br>
Business layer statistics, relative to the data obtained from the network card, the data here does not include the size of the header<br>
For http messages, does not include http header size</td>
</tr>
<tr>
<td>bytesWritten</td>
<td>Average number of bytes sent per second during the current period (Bps)<br>
Business layer statistics, relative to the data obtained from the network card, the data here does not include the size of the header<br>
For http messages, does not include http header size</td>
</tr>
</table>
<h3 id="4-vertx-server-endpoints">4. vertx server endpoints</h3>
<table class="metrics-table">
<tr>
<th>Name</th>
<th>Tag keys</th>
<th>Tag values</th>
<th>Description</th>
</tr>
<tr>
<td rowspan="8">servicecomb<br>.vertx<br>.endpoints</td>
<td>type</td>
<td>server</td>
<td></td>
</tr>
<tr>
<td>address</td>
<td>${ip}:${port}</td>
<td>listen ip:port</td>
</tr>
<tr>
<td rowspan="6">statistic</td>
<td>connectCount</td>
<td>Number of connections are connected in the current period</td>
</tr>
<tr>
<td>disconnectCount</td>
<td>Number of disconnections in the current period</td>
</tr>
<tr>
<td>rejectByConnectionLimit</td>
<td>Number of active disconnections due to exceeding the number of connections in the current period</td>
</tr>
<tr>
<td>connections</td>
<td>Current connection number</td>
</tr>
<tr>
<td>bytesRead</td>
<td>Average number of bytes sent per second during the current period (Bps)<br>
Business layer statistics, relative to the data obtained from the network card, the data here does not include the size of the header<br>
For http messages, does not include http header size</td>
</tr>
<tr>
<td>bytesWritten</td>
<td>Average number of bytes received per second during the current period (Bps)<br>
Business layer statistics, relative to the data obtained from the network card, the data here does not include the size of the header<br>
For http messages, does not include http header size</td>
</tr>
</table>
<h3 id="5-invocation-latency-distribution">5. Invocation latency distribution</h3>
<table class="metrics-table">
<tr>
<th>Name</th>
<th>Tag keys</th>
<th>Tag values</th>
<th>Description</th>
</tr>
<tr>
<td rowspan="11">servicecomb<br>.invocation</td>
<td>role</td>
<td>CONSUMER、PRODUCER、EDGE</td>
<td>Is the CONSUMER, PRODUCER or EDGE side statistics</td>
</tr>
<tr>
<td>operation</td>
<td>${microserviceName}<br>.${schemaId}<br>.${operationName}</td>
<td>Method name called</td>
</tr>
<tr>
<td>transport</td>
<td>highway or rest</td>
<td>On which transmission channel the call is made</td>
</tr>
<tr>
<td>status</td>
<td>http status code</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>latencyDistribution</td>
<td>invocation latency distribution</td>
</tr>
<tr>
<td>scope</td>
<td>[${min}, ${max})</td>
<td>The call count in the current period that latency is greater than or equal to min, less than max<br>
[${min},) means max is infinite</td>
</tr>
</table>
<h3 id="6-invocation-consumer-stage-latency">6. invocation consumer stage latency</h3>
<table class="metrics-table">
<tr>
<th>Name</th>
<th>Tag keys</th>
<th>Tag values</th>
<th>Description</th>
</tr>
<tr>
<td rowspan="19">servicecomb<br>.invocation</td>
<td>role</td>
<td>CONSUMER</td>
<td>Statistics on the CONSUMER side</td>
</tr>
<tr>
<td>operation</td>
<td>${microserviceName}<br>.${schemaId}<br>.${operationName}</td>
<td>Method name called</td>
</tr>
<tr>
<td>transport</td>
<td>highway or rest</td>
<td>On which transmission channel the call is made</td>
</tr>
<tr>
<td>status</td>
<td>http status code</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>stage</td>
<td>stage latency</td>
</tr>
<tr>
<td rowspan="11">stage</td>
<td>total</td>
<td>The whole process</td>
</tr>
<tr>
<td>prepare</td>
<td></td>
</tr>
<tr>
<td>handlers_request</td>
<td>Handler chain request process</td>
</tr>
<tr>
<td>client_filters_request</td>
<td>Http client filter chain request process<br>
Only the rest transport has this stage.</td>
</tr>
<tr>
<td>consumer_send_request</td>
<td>Send request stage, including consumer_get_connection and consumer_write_to_buf</td>
</tr>
<tr>
<td>consumer_get_connection</td>
<td>Get a connection from the connection pool</td>
</tr>
<tr>
<td>consumer_write_to_buf</td>
<td>Write data to the network buffer</td>
</tr>
<tr>
<td>consumer_wait_response</td>
<td>Waiting for the server to answer</td>
</tr>
<tr>
<td>consumer_wake_consumer</td>
<td>In the synchronization process, after receiving the response, it takes time from waking up the waiting thread to waiting for the thread to start processing the response.</td>
</tr>
<tr>
<td>client_filters_response</td>
<td>Http client filter chain response process</td>
</tr>
<tr>
<td>handlers_response</td>
<td>Handler chain response process</td>
</tr>
<tr>
<td rowspan="3">statistic</td>
<td>count</td>
<td>Average number of calls per second (TPS)<br>
Count=Number of calls/period in the statistical period (seconds)</td>
</tr>
<tr>
<td>totalTime</td>
<td>In seconds<br>
totalTime=The total duration of the call in the current period (seconds)<br>
totalTime divided by count to get the average latency</td>
</tr>
<tr>
<td>max</td>
<td>In seconds<br>
Maximum latency in the current period</td>
</tr>
</table>
<h3 id="7-invocation-producer-stage-latency">7. invocation producer stage latency</h3>
<table class="metrics-table">
<tr>
<th>Name</th>
<th>Tag keys</th>
<th>Tag values</th>
<th>Description</th>
</tr>
<tr>
<td rowspan="17">servicecomb<br>.invocation</td>
<td>role</td>
<td>PRODUCER</td>
<td>Statistics on the PRODUCER side</td>
</tr>
<tr>
<td>operation</td>
<td>${microserviceName}<br>.${schemaId}<br>.${operationName}</td>
<td>Method name called</td>
</tr>
<tr>
<td>transport</td>
<td>highway or rest</td>
<td>On which transmission channel the call is made</td>
</tr>
<tr>
<td>status</td>
<td>http status code</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>stage</td>
<td>stage latency</td>
</tr>
<tr>
<td rowspan="9">stage</td>
<td>total</td>
<td>The whole process</td>
</tr>
<tr>
<td>prepare</td>
<td></td>
</tr>
<tr>
<td>queue</td>
<td>Meaning only when using a thread pool<br>
Indicates the length of time the call is queued in the thread pool</td>
</tr>
<tr>
<td>server_filters_request</td>
<td>Http server filter chain request process<br>
Only the rest transport has this stage.</td>
</tr>
<tr>
<td>handlers_request</td>
<td>Handler chain request process</td>
</tr>
<tr>
<td>execution</td>
<td>Business method</td>
</tr>
<tr>
<td>handlers_response</td>
<td>Handler chain response process</td>
</tr>
<tr>
<td>server_filters_response</td>
<td>Http server filter chain response process</td>
</tr>
<tr>
<td>producer_send_response</td>
<td>Send a response</td>
</tr>
<tr>
<td rowspan="3">statistic</td>
<td>count</td>
<td>Average number of calls per second (TPS)<br>
Count=Number of calls/period in the statistical period (seconds)</td>
</tr>
<tr>
<td>totalTime</td>
<td>In seconds<br>
totalTime=The total duration of the call in the current period (seconds)<br>
AverageTime divided by count to get the average latency</td>
</tr>
<tr>
<td>max</td>
<td>In seconds<br>
Maximum latency in the current period</td>
</tr>
</table>
<h3 id="8-invocation-edge-stage-latency">8. invocation edge stage latency</h3>
<table class="metrics-table">
<tr>
<th>Name</th>
<th>Tag keys</th>
<th>Tag values</th>
<th>Description</th>
</tr>
<tr>
<td rowspan="23">servicecomb<br>.invocation</td>
<td>role</td>
<td>EDGE</td>
<td>EDGE statistics</td>
</tr>
<tr>
<td>operation</td>
<td>${microserviceName}<br>.${schemaId}<br>.${operationName}</td>
<td>Method name called</td>
</tr>
<tr>
<td>transport</td>
<td>highway or rest</td>
<td>On which transmission channel the call is made</td>
</tr>
<tr>
<td>status</td>
<td>http status code</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>stage</td>
<td>stage latency</td>
</tr>
<tr>
<td rowspan="15">stage</td>
<td>total</td>
<td>The whole process</td>
</tr>
<tr>
<td>prepare</td>
<td></td>
</tr>
<tr>
<td>queue</td>
<td>Meaning only when using a thread pool<br>
Indicates the length of time the call is queued in the thread pool</td>
</tr>
<tr>
<td>server_filters_request</td>
<td>Http server filter chain request process</td>
</tr>
<tr>
<td>handlers_request</td>
<td>Handler chain request process</td>
</tr>
<tr>
<td>client_filters_request</td>
<td>Http client filter chain request process</td>
</tr>
<tr>
<td>consumer_send_request</td>
<td>Send request stage, including consumer_get_connection and consumer_write_to_buf</td>
</tr>
<tr>
<td>consumer_get_connection</td>
<td>Get a connection from the connection pool</td>
</tr>
<tr>
<td>consumer_write_to_buf</td>
<td>Write data to the network buffer</td>
</tr>
<tr>
<td>consumer_wait_response</td>
<td>Waiting for the server to answer</td>
</tr>
<tr>
<td>consumer_wake_consumer</td>
<td>In the synchronization process, after receiving the response, it takes time from waking up the waiting thread to waiting for the thread to start processing the response.</td>
</tr>
<tr>
<td>client_filters_response</td>
<td>Http client filter chain response process</td>
</tr>
<tr>
<td>handlers_response</td>
<td>Handler chain response process</td>
</tr>
<tr>
<td>server_filters_response</td>
<td>Http server filter chain response process</td>
</tr>
<tr>
<td>producer_send_response</td>
<td>Send a response</td>
</tr>
<tr>
<td rowspan="3">statistic</td>
<td>count</td>
<td>Average number of calls per second (TPS)<br>
Count=Number of calls/period in the statistical period (seconds)</td>
</tr>
<tr>
<td>totalTime</td>
<td>In seconds<br>
totalTime=The total duration of the call in the current period (seconds)<br>
AverageTime divided by count to get the average latency</td>
</tr>
<tr>
<td>max</td>
<td>In seconds<br>
Maximum latency in the current period</td>
</tr>
</table>
<h3 id="9-threadpool">9. threadpool</h3>
<table class="metrics-table">
<tr>
<th>Name</th>
<th>Tag keys</th>
<th>Tag values</th>
<th>Description</th>
</tr>
<tr>
<td>threadpool.corePoolSize </td>
<td rowspan="8">id</td>
<td rowspan="8">${threadPoolName}</td>
<td>Minimum number of threads</td>
</tr>
<tr>
<td>threadpool.maxThreads </td>
<td>Maximum number of threads allowed</td>
</tr>
<tr>
<td>threadpool.poolSize </td>
<td>Current actual number of threads</td>
</tr>
<tr>
<td>threadpool.currentThreadsBusy </td>
<td>The current number of active threads, which is the number of tasks currently being executed</td>
</tr>
<tr>
<td>threadpool.queueSize </td>
<td>Number of tasks currently queued</td>
</tr>
<tr>
<td>threadpool.rejectedCount </td>
<td>The average number of tasks rejected per second during the current period</td>
</tr>
<tr>
<td>threadpool.taskCount</td>
<td>Average number of tasks submitted per second during the statistical period<br>
taskCount=(completed + queue + active)/period (seconds)</td>
</tr>
<tr>
<td>threadpool.completedTaskCount </td>
<td>The average number of tasks completed per second during the statistical period<br>
completedTaskCount=completed/period (seconds)</td>
</tr>
</table>
<h1 id="fourth-business-customization">Fourth, business customization</h1>
<p>Because ServiceComb has initialized the registry's registry, the business no longer has to create a registry.</p>
<p>Implement the MetricsInitializer interface, define the business-level Meters, or implement a custom Publisher, and then declare your implementation through the SPI mechanism.</p>
<h3 id="1meters">1.Meters:</h3>
<p>Creating Meters capabilities is provided by spectator, available in the [netflix spectator] (https://github.com/Netflix/spectator) documentation</p>
<h3 id="2publisher">2.Publisher:</h3>
<p>Periodically output scenarios, such as log scenarios, subscribe to org.apache.servicecomb.foundation.metrics.PolledEvent via eventBus, PolledEvent.getMeters() is the statistical result of this cycle.
Non-periodic output scenarios, such as access through the RESTful interface, the statistical results of this cycle can be obtained through globalRegistry.iterator()</p>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": [], "search": "../../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../../assets/javascripts/bundle.dd8806f2.min.js"></script>
</body>
</html>