system.metric_log

Contains history of metrics values from tables system.metrics and system.events, periodically flushed to disk.
To turn on metrics history collection on system.metric_log, create /etc/clickhouse-server/config.d/metric_log.xml with following content:

  1. <yandex>
  2. <metric_log>
  3. <database>system</database>
  4. <table>metric_log</table>
  5. <flush_interval_milliseconds>7500</flush_interval_milliseconds>
  6. <collect_interval_milliseconds>1000</collect_interval_milliseconds>
  7. </metric_log>
  8. </yandex>

Example

  1. SELECT * FROM system.metric_log LIMIT 1 FORMAT Vertical;
  1. Row 1:
  2. ──────
  3. event_date: 2020-09-05
  4. event_time: 2020-09-05 16:22:33
  5. event_time_microseconds: 2020-09-05 16:22:33.196807
  6. milliseconds: 196
  7. ProfileEvent_Query: 0
  8. ProfileEvent_SelectQuery: 0
  9. ProfileEvent_InsertQuery: 0
  10. ProfileEvent_FailedQuery: 0
  11. ProfileEvent_FailedSelectQuery: 0
  12. ...
  13. ...
  14. CurrentMetric_Revision: 54439
  15. CurrentMetric_VersionInteger: 20009001
  16. CurrentMetric_RWLockWaitingReaders: 0
  17. CurrentMetric_RWLockWaitingWriters: 0
  18. CurrentMetric_RWLockActiveReaders: 0
  19. CurrentMetric_RWLockActiveWriters: 0
  20. CurrentMetric_GlobalThread: 74
  21. CurrentMetric_GlobalThreadActive: 26
  22. CurrentMetric_LocalThread: 0
  23. CurrentMetric_LocalThreadActive: 0
  24. CurrentMetric_DistributedFilesToInsert: 0

See also

Original article