Dianping CAT
Dianping-cat Cat is an open-source distributed real-time monitoring system mainly used to monitor the performance, capacity, and business indicators of the system. It is a monitoring system developed by Meituan Dianping Company and is currently open source and widely used.
Cat collects various indicator data of the system, such as CPU, memory, network, disk, etc., for real-time monitoring and analysis, helping developers quickly locate and solve system problems. At the same time, it also provides some commonly used monitoring functions, such as alarms, statistics, log analysis, etc., to facilitate system monitoring and analysis by developers.
Data Type¶
Data transmission protocol:
-
Plaintext: Plain text mode, currently not supported by DataKit.
-
Native: Text form separated by specific symbols, currently supported by DataKit.
Data Classification:
| type | long type | doc | DataKit support | Corresponding data type |
|---|---|---|---|---|
| t | transaction start | transaction start | true | trace |
| T | transaction end | transaction end | true | trace |
| E | event | event | false | - |
| M | metric | metric | false | - |
| L | trace | trace | false | - |
| H | heartbeat | heartbeat | true | metric |
CAT start mode¶
The data is all in the DataKit, and the web page of cat no longer has data, so the significance of starting is not significant.
Moreover, the cat server will also send transaction data to the dk, causing a large amount of garbage data on the Guance page. It is not recommended to start a cat_ Home (cat server) service.
The corresponding configuration can be configured in client.xml, please refer to the following text.
Configuration¶
client config:
<?xml version="1.0" encoding="utf-8"?>
<config mode="client">
<servers>
<!-- datakit ip, cat port , http port -->
<server ip="10.200.6.16" port="2280" http-port="9529"/>
</servers>
</config>
Note: The 9529 port in the configuration is the HTTP port of the DataKit. 2280 is the 2280 port opened by the cat input.
Go to the conf.d/cat directory under the DataKit installation directory, copy cat.conf.sample and name it cat.conf. Examples are as follows:
[[inputs.cat]]
## tcp port
tcp_port = "2280"
##native or plaintext, datakit only support native(NT1) !!!
decode = "native"
## This is default cat-client Kvs configs.
startTransactionTypes = "Cache.;Squirrel."
MatchTransactionTypes = "SQL"
block = "false"
routers = "127.0.0.1:2280;"
sample = "1.0"
## global tags.
# [inputs.cat.tags]
# key1 = "value1"
# key2 = "value2"
# ...
The collector can now be turned on by ConfigMap Injection Collector Configuration.
Notes on configuration files:
startTransactionTypesMatchTransactionTypesblockrouterssampleis the data returned to the client endroutersis DataKit IP or Domaintcp_portclient configservers ipaddress
Tracing¶
cat¶
Following is tags/fields of tracing data
| Tags & Fields | Description |
|---|---|
| base_service ( tag) |
Span base service name |
| container_host ( tag) |
Container hostname. Available in OpenTelemetry. Optional. |
| db_host ( tag) |
DB host name: ip or domain name. Optional. |
| db_name ( tag) |
Database name. Optional. |
| db_system ( tag) |
Database system name:mysql,oracle... Optional. |
| dk_fingerprint ( tag) |
DataKit fingerprint(always DataKit's hostname) |
| endpoint ( tag) |
Endpoint info. Available in SkyWalking, Zipkin. Optional. |
| env ( tag) |
Application environment info. Available in Jaeger. Optional. |
| host ( tag) |
Hostname. |
| http_method ( tag) |
HTTP request method name. Available in DDTrace, OpenTelemetry. Optional. |
| http_route ( tag) |
HTTP route. Optional. |
| http_status_code ( tag) |
HTTP response code. Available in DDTrace, OpenTelemetry. Optional. |
| http_url ( tag) |
HTTP URL. Optional. |
| operation ( tag) |
Span name |
| out_host ( tag) |
This is the database host, equivalent to db_host,only DDTrace-go. Optional. |
| project ( tag) |
Project name. Available in Jaeger. Optional. |
| service ( tag) |
Service name. Optional. |
| source_type ( tag) |
Tracing source type |
| span_type ( tag) |
Span type |
| status ( tag) |
Span status |
| version ( tag) |
Application version info. Available in Jaeger. Optional. |
| duration | Duration of span Type: int | (gauge) Unit: time,μs |
| message | Origin content of span Type: string Unit: N/A |
| parent_id | Parent span ID of current span Type: string Unit: N/A |
| resource | Resource name produce current span Type: string Unit: N/A |
| span_id | Span id Type: string Unit: N/A |
| start | start time of span. Type: int | (gauge) Unit: timeStamp,usec |
| trace_id | Trace id Type: string Unit: N/A |
Metric¶
Metric cat¶
CAT heartbeat runtime, operating system, disk, memory, and thread metrics emitted from application heartbeat XML payloads.
| Tags & Fields | Description |
|---|---|
| domain ( tag) |
CAT application domain. |
| hostName ( tag) |
Host name reported by CAT. |
| memory_gc_name ( tag) |
Garbage collector name for CAT GC points. |
| os_arch ( tag) |
CPU architecture such as AMD64 or ARM. |
| os_name ( tag) |
Operating system name on OS points; reused as disk volume ID on CAT disk points. |
| os_version ( tag) |
OS or kernel version. |
| runtime_java-version ( tag) |
Java version. |
| runtime_user-dir ( tag) |
User working directory reported in the CAT runtime block. |
| runtime_user-name ( tag) |
User name. |
| disk_free | Free disk size of the reported disk volume. Type: float | (gauge) Unit: digital,B Tagged by: domain, hostName, os_name |
| disk_total | Total disk size of the reported disk volume. Type: float | (gauge) Unit: digital,B Tagged by: domain, hostName, os_name |
| disk_usable | Usable disk size of the reported disk volume. Type: float | (gauge) Unit: digital,B Tagged by: domain, hostName, os_name |
| memory_free | Current free JVM memory size. Type: float | (gauge) Unit: count Tagged by: domain, hostName |
| memory_gc_count | Garbage collection count reported for the named GC. Type: int | (gauge) Unit: count Tagged by: domain, hostName, memory_gc_name |
| memory_gc_time | Garbage collection time reported for the named GC, in milliseconds. Type: int | (gauge) Unit: time,ms Tagged by: domain, hostName, memory_gc_name |
| memory_heap-usage | Used JVM heap memory. Type: float | (gauge) Unit: count Tagged by: domain, hostName |
| memory_max | Maximum JVM memory size. Type: float | (gauge) Unit: count Tagged by: domain, hostName |
| memory_non-heap-usage | Used JVM non-heap memory. Type: float | (gauge) Unit: count Tagged by: domain, hostName |
| memory_total | Current total JVM memory size. Type: float | (gauge) Unit: count Tagged by: domain, hostName |
| os_available-processors | The number of available processors in the host. Type: float | (gauge) Unit: count Tagged by: domain, hostName, os_arch, os_name, os_version |
| os_committed-virtual-memory | Committed virtual memory size. Type: float | (gauge) Unit: digital,B Tagged by: domain, hostName, os_arch, os_name, os_version |
| os_free-physical-memory | Free physical memory size. Type: float | (gauge) Unit: digital,B Tagged by: domain, hostName, os_arch, os_name, os_version |
| os_free-swap-space | Free swap space size Type: float | (gauge) Unit: digital,B Tagged by: domain, hostName, os_arch, os_name, os_version |
| os_system-load-average | Average system load. Type: float | (gauge) Unit: percent,percent Tagged by: domain, hostName, os_arch, os_name, os_version |
| os_total-physical-memory | Total physical memory size. Type: float | (gauge) Unit: digital,B Tagged by: domain, hostName, os_arch, os_name, os_version |
| os_total-swap-space | Total swap space size. Type: float | (gauge) Unit: digital,B Tagged by: domain, hostName, os_arch, os_name, os_version |
| runtime_start-time | JVM start time reported by CAT, as a Unix timestamp in seconds. Type: int | (gauge) Unit: time,s Tagged by: domain, hostName, runtime_java-version, runtime_user-dir, runtime_user-name |
| runtime_up-time | JVM uptime reported by CAT, in milliseconds. Type: int | (gauge) Unit: time,ms Tagged by: domain, hostName, runtime_java-version, runtime_user-dir, runtime_user-name |
| thread_cat_thread_count | The number of threads used by CAT. Type: float | (gauge) Unit: count Tagged by: domain, hostName |
| thread_count | Total number of threads. Type: float | (gauge) Unit: count Tagged by: domain, hostName |
| thread_daemon_count | The number of daemon threads. Type: float | (gauge) Unit: count Tagged by: domain, hostName |
| thread_http_thread_count | The number of HTTP threads. Type: float | (gauge) Unit: count Tagged by: domain, hostName |
| thread_peek_count | Peak thread count. Type: float | (gauge) Unit: count Tagged by: domain, hostName |
| thread_pigeon_thread_count | The number of Pigeon threads. Type: float | (gauge) Unit: count Tagged by: domain, hostName |
| thread_total_started_count | Total number of started threads. Type: float | (gauge) Unit: count Tagged by: domain, hostName |