system.metric_log
在 ClickHouse Cloud 中查询
此系统表中的数据在 ClickHouse Cloud 中的每个节点上本地保存。因此,要获得所有数据的完整视图,需要使用 clusterAllReplicas
函数。有关进一步的详细信息,请参见 这里。
包含来自 system.metrics
和 system.events
表的指标值历史,定期刷新到磁盘。
列:
hostname
(LowCardinality(String)) — 执行查询的服务器主机名。event_date
(Date) — 事件日期。event_time
(DateTime) — 事件时间。event_time_microseconds
(DateTime64) — 带有微秒分辨率的事件时间。
示例
模式
该表可以使用 XML 标签 <schema_type>
配置为不同的模式类型。默认模式类型为 wide
,其中每个指标或配置事件作为单独的列存储。该模式对于单列读取是最优和高效的。
transposed
模式以类似于 system.asynchronous_metric_log
的格式存储数据,其中指标和事件作为行存储。由于减少了合并期间的资源消耗,该模式对于低资源设置非常有用。
还存在兼容性模式 transposed_with_wide_view
,它在具有转置模式的表(system.transposed_metric_log
)中存储实际数据,并在其上使用宽模式创建视图。该视图查询转置表,使其在从 wide
模式迁移到 transposed
模式时非常有用。
另见
- metric_log 设置 — 启用和禁用设置。
- system.asynchronous_metrics — 包含定期计算的指标。
- system.events — 包含发生的多个事件。
- system.metrics — 包含即时计算的指标。
- 监控 — ClickHouse 监控的基本概念。