MySQL 状态度量集编辑

MySQL status 度量集通过运行 SHOW GLOBAL STATUS; SQL 查询从 MySQL 收集数据。此查询返回大量指标。

raw 配置选项编辑

此功能处于技术预览阶段,可能会在将来的版本中更改或删除。Elastic 将努力解决任何问题,但技术预览中的功能不受官方 GA 功能的 SLA 支持。

MySQL 状态度量集支持 raw 配置选项。启用后,除了现有的数据结构之外,通过 "SHOW /*!50002 GLOBAL */ STATUS;" 从 mysql 服务获得的所有字段都将被添加到事件中。

这些字段将被添加到命名空间 mysql.status.raw 下。这些字段可能因 MySQL 实例而异,并且不保证字段的映射,因为映射是动态发生的。此选项适用于高级用例。

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

字段

有关度量集中每个字段的描述,请参见 导出字段 部分。

这是一个由该度量集生成的示例文档

{
    "@timestamp": "2020-07-13T16:36:00.626Z",
    "@metadata": {
        "beat": "metricbeat",
        "type": "_doc",
        "version": "8.0.0"
    },
    "agent": {
        "version": "8.0.0",
        "ephemeral_id": "d9d0d455-c440-453e-aea3-3b6fa512f6f3",
        "id": "803dfdba-e638-4590-a2de-80cb1cebe78d",
        "name": "mcastro",
        "type": "metricbeat"
    },
    "mysql": {
        "status": {
            "connections": 28,
            "threads": {
                "running": 2,
                "cached": 1,
                "created": 4,
                "connected": 3
            },
            "innodb": {
                "rows": {
                    "updated": 0,
                    "deleted": 0,
                    "inserted": 0,
                    "reads": 0
                },
                "buffer_pool": {
                    "write_requests": 1634,
                    "bytes": {
                        "data": 15908864,
                        "dirty": 0
                    },
                    "pages": {
                        "data": 971,
                        "dirty": 0,
                        "flushed": 144,
                        "free": 7216,
                        "misc": 5,
                        "total": 8192
                    },
                    "read": {
                        "requests": 15600,
                        "ahead": 0,
                        "ahead_evicted": 0,
                        "ahead_rnd": 0
                    },
                    "pool": {
                        "reads": 830,
                        "wait_free": 0
                    }
                }
            },
            "handler": {
                "update": 315,
                "read": {
                    "rnd_next": 394983,
                    "first": 33,
                    "key": 2100,
                    "last": 0,
                    "next": 4533,
                    "prev": 0,
                    "rnd": 2494
                },
                "write": 168505,
                "mrr_init": 0,
                "delete": 0,
                "external_lock": 8167,
                "savepoint_rollback": 0,
                "rollback": 0,
                "commit": 625,
                "savepoint": 0,
                "prepare": 0
            },
            "bytes": {
                "sent": 6228481,
                "received": 143324
            },
            "created": {
                "tmp": {
                    "tables": 364,
                    "disk_tables": 0,
                    "files": 5
                }
            },
            "binlog": {
                "cache": {
                    "disk_use": 0,
                    "use": 0
                }
            },
            "connection": {
                "errors": {
                    "max": 0,
                    "peer_address": 0,
                    "select": 0,
                    "tcpwrap": 0,
                    "accept": 0,
                    "internal": 0
                }
            },
            "delayed": {
                "errors": 0,
                "insert_threads": 0,
                "writes": 0
            },
            "max_used_connections": 4,
            "opened_tables": 195,
            "queries": 1183,
            "flush_commands": 3,
            "command": {
                "insert": 0,
                "select": 705,
                "update": 0,
                "delete": 0
            },
            "aborted": {
                "clients": 0,
                "connects": 2
            },
            "cache": {
                "table": {
                    "open_cache": {
                        "hits": 3889,
                        "misses": 195,
                        "overflows": 0
                    }
                },
                "ssl": {
                    "size": 128,
                    "hits": 0,
                    "misses": 0
                }
            },
            "questions": 1173,
            "open": {
                "streams": 0,
                "tables": 116,
                "files": 2
            }
        }
    },
    "event": {
        "dataset": "mysql.status",
        "module": "mysql",
        "duration": 1871014
    },
    "metricset": {
        "name": "status",
        "period": 10000
    },
    "service": {
        "address": "172.17.0.2:3306",
        "type": "mysql"
    },
    "ecs": {
        "version": "1.5.0"
    },
    "host": {
        "name": "mcastro"
    }
}