**CAT** [![Build Status](https://travis-ci.org/dianping/cat.png?branch=master)](https://travis-ci.org/dianping/cat) [![GitHub stars](https://img.shields.io/github/stars/dianping/cat.svg?style=social&label=Star&)](https://github.com/dianping/cat/stargazers) [![GitHub forks](https://img.shields.io/github/forks/dianping/cat.svg?style=social&label=Fork&)](https://github.com/dianping/cat/fork) ### CAT 简介 - CAT 是基于 Java 开发的实时应用监控平台,为美团点评提供了全面的实时监控告警服务。 - CAT 作为服务端项目基础组件,提供了Java, C/C++, Node.js, Python, Go等多语言客户端,已经在美团点评的基础架构中间件框架(MVC框架,RPC框架,数据库框架,缓存框架等,消息队列,配置系统等)深度集成,为美团点评各业务线提供系统丰富的性能指标、健康状况、实时告警等。 - CAT 很大的优势是它是一个实时系统,CAT大部分系统是分钟级统计,但是从数据生成到服务端处理结束是秒级别,秒级定义是48分钟40秒,基本上看到48分钟38秒数据,整体报表的统计粒度是分钟级;第二个优势,监控数据是全量统计,客户端预计算;链路数据是采样计算。 ### Cat 产品价值 - 减少故障发现时间 - 降低故障定位成本 - 辅助应用程序优化 ### Cat 优势 - 实时处理:信息的价值会随时间锐减,尤其是事故处理过程中 - 全量数据:全量采集指标数据,便于深度分析故障案例 - 高可用:故障的还原与问题定位,需要高可用监控来支撑 - 故障容忍:故障不影响业务正常运转、对业务透明 - 高吞吐:海量监控数据的收集,需要高吞吐能力做保证 - 可扩展:支持分布式、跨 IDC 部署,横向扩展的监控系统 ### CAT 支持的监控消息类型: + **Transaction** 适合记录跨越系统边界的程序访问行为,比如远程调用,数据库调用,也适合执行时间较长的业务逻辑监控,Transaction用来记录一段代码的执行时间和次数。 + **Event** 用来记录一件事发生的次数,比如记录系统异常,它和transaction相比缺少了时间的统计,开销比transaction要小。 + **Heartbeat** 表示程序内定期产生的统计信息, 如CPU%, MEM%, 连接池状态, 系统负载等。 + **Metric** 用于记录业务指标、指标可能包含对一个指标记录次数、记录平均值、记录总和,业务指标最低统计粒度为1分钟。 #### 消息树 CAT监控系统将每次URL、Service的请求内部执行情况都封装为一个完整的消息树、消息树可能包括Transaction、Event、Heartbeat、Metric等信息。 - 完整的消息树 ![Alt text](https://raw.github.com/dianping/cat/master/cat-home/src/main/webapp/images/logviewAll01.png) - 可视化消息树 ![Alt text](https://raw.github.com/dianping/cat/master/cat-home/src/main/webapp/images/logviewAll02.png) - 分布式消息树【一台机器调用另外一台机器】 ![Alt text](https://raw.github.com/dianping/cat/master/cat-home/src/main/webapp/images/logviewAll03.png) ### 模块简介 #### 功能模块 - cat-client: 客户端,上报监控数据 > 根目录下 cat-client 模块以后不再维护,目前仅做服务端的依赖模块。下个大版本更新计划移除。新版Java客户端参考:lib/java - cat-consumer: 服务端,收集监控数据进行统计分析,构建丰富的统计报表 - cat-alarm: 实时告警,提供报表指标的监控告警 - cat-hadoop: 数据存储,logview 存储 Hdfs - cat-home: 管理端,报表展示、配置管理等 `说明:管理端、服务端、告警服务均使用 cat-home 模块部署即可` #### 其他模块 - cat-doc:服务端报表使用文档 - integration:cat和一些第三方工具集成的内容(此部分一部分是由社区贡献,一部分官方贡献) - lib:CAT 的客户端,包括Java、C/C++、Python、Node.js、Go - script:CAT 数据库脚本 ### Quick Start #### Cat客户端集成 Cat目前支持::Java、C、Python、node、Go等语言的接入。详情请参考:[传送门](https://github.com/dianping/cat/tree/master/lib) * [**Java**](https://github.com/dianping/cat/blob/master/lib/java) * [**C**](https://github.com/dianping/cat/blob/master/lib/c) * [**C++**](https://github.com/dianping/cat/blob/master/lib/cpp) * [**Python**](https://github.com/dianping/cat/blob/master/lib/python) * [**Go**](https://github.com/dianping/cat/blob/master/lib/go) * [**Node.js**](https://github.com/dianping/cat/blob/master/lib/node.js) #### CAT 服务端 - [依赖环境安装](https://github.com/dianping/cat-docs) - [服务端集群部署](https://github.com/dianping/cat/blob/master/cat-doc/posts/ch4-server/README.md) - [服务端报表介绍](https://github.com/dianping/cat/blob/master/cat-doc/posts/ch1-report/README.md) - [服务端配置手册](https://github.com/dianping/cat/blob/master/cat-doc/posts/ch2-config/README.md) ### 更新日志 - [**最新版本特性一览**](https://github.com/dianping/cat/blob/master/cat-doc/posts/ch0-release/new.md) - [**ChangeLog**](https://github.com/dianping/cat/blob/master/cat-doc/posts/ch0-release/changelog.md) ### 项目设计 - [项目架构](https://github.com/dianping/cat/blob/master/cat-doc/posts/ch5-design/overall.md) - [客户端设计](https://github.com/dianping/cat/blob/master/cat-doc/posts/ch5-design/client.md) - [服务端设计](https://github.com/dianping/cat/blob/master/cat-doc/posts/ch5-design/server.md) ### Copyright and license ``` /* * Copyright (c) 2011-2018, Meituan Dianping. All Rights Reserved. * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ ``` ### CAT 接入公司 ![Alt text](https://raw.github.com/dianping/cat/master/cat-home/src/main/webapp/images/logo/companys.png) 更多接入公司,欢迎在登记 ### 联系我们 我们需要知道你对Cat的一些看法以及建议:cat@dianping.com,以及 [Github Issues](https://github.com/dianping/cat/issues)