Tomcat 线程指标集编辑

此功能处于测试阶段,可能发生变化。设计和代码的成熟度低于官方 GA 功能,按原样提供,不提供任何担保。测试功能不适用官方 GA 功能的支持 SLA。

线程指标集使用 Jolokia 检索 JMX 键 Catalina:name=*,type=ThreadPooljava.lang:type=Threading。它公开以下指标

  • tomcat.threading.busy: 线程池中当前繁忙的线程
  • tomcat.threading.max: 线程池中的最大线程数
  • tomcat.threading.current: 当前线程数,取自线程池
  • tomcat.threading.keep_alive.total: 线程池上的总保活线程数
  • tomcat.threading.keep_alive.timeout.ms: 线程池上的保活超时时间(毫秒)
  • tomcat.threading.started.total: JVM 级别当前已启动的线程数(来自 java.lang:type=Threading)
  • tomcat.threading.user.time.ms: 用户时间(毫秒)(来自 java.lang:type=Threading)
  • tomcat.threading.cpu.time.ms: CPU 时间(毫秒)(来自 java.lang:type=Threading)
  • tomcat.threading.total: JVM 级别总线程数(来自 java.lang:type=Threading)
  • tomcat.threading.peak: JVM 级别峰值线程数(来自 java.lang:type=Threading)

这是一个默认指标集。如果主机模块未配置,则默认情况下启用此指标集。

字段

有关指标集中每个字段的描述,请参阅 导出字段 部分。

以下是由此指标集生成的示例文档

{
    "@timestamp": "2019-09-16T11:24:36.957Z",
    "@metadata": {
        "beat": "metricbeat",
        "type": "_doc",
        "version": "8.0.0"
    },
    "event": {
        "duration": 7677063,
        "dataset": "tomcat.threading",
        "module": "tomcat"
    },
    "metricset": {
        "name": "threading",
        "period": 10000
    },
    "service": {
        "type": "tomcat",
        "address": "localhost:8080"
    },
    "tomcat": {
        "threading": {
            "total": 35,
            "started": {
                "total": 35
            },
            "user": {
                "time": {
                    "ms": 6e+07
                }
            },
            "peak": 35,
            "cpu": {
                "time": {
                    "ms": 6.9719161e+07
                }
            }
        }
    },
    "ecs": {
        "version": "1.1.0"
    },
    "host": {
        "hostname": "mcastro",
        "architecture": "x86_64",
        "os": {
            "name": "Antergos Linux",
            "kernel": "5.0.13-arch1-1-ARCH",
            "platform": "antergos",
            "version": "",
            "family": ""
        },
        "id": "54f70115bae545cbac2b150f254472a0",
        "containerized": false,
        "name": "mcastro"
    },
    "agent": {
        "ephemeral_id": "a4cc9624-50c1-462c-b254-fa45896ebdfb",
        "hostname": "mcastro",
        "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228",
        "version": "8.0.0",
        "type": "metricbeat"
    }
}