Skip to main content
Skip to main content

system.metric_log

Querying in ClickHouse Cloud

The data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the clusterAllReplicas function. See here for further details.

Contains history of metrics values from tables system.metrics and system.events, periodically flushed to disk.

Columns:

  • hostname (LowCardinality(String)) — Hostname of the server executing the query.
  • event_date (Date) — Event date.
  • event_time (DateTime) — Event time.
  • event_time_microseconds (DateTime64) — Event time with microseconds resolution.

Example

Schema This table can be configured with different schema types using the XML tag <schema_type>. The default schema type is wide, where each metric or profile event is stored as a separate column. This schema is the most performant and efficient for single-column reads.

The transposed schema stores data in a format similar to system.asynchronous_metric_log, where metrics and events are stored as rows. This schema is useful for low-resource setups because it reduces resource consumption during merges.

There is also a compatibility schema, transposed_with_wide_view, which stores actual data in a table with the transposed schema (system.transposed_metric_log) and creates a view on top of it using the wide schema. This view queries the transposed table, making it useful for migrating from the wide schema to the transposed schema.

See also

Try ClickHouse Cloud for FREE

Separation of storage and compute, automatic scaling, built-in SQL console, and lots more. $300 in free credits when signing up.

Try it for Free