title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/metric_log.md)

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](/docs/operations/system-tables/overview#system-tables-in-clickhouse-cloud) for further details.

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

Columns:

- `hostname` ([LowCardinality(String)](/docs/sql-reference/data-types/string)) — Hostname of the server executing the query.
- `event_date` ([Date](/docs/sql-reference/data-types/date)) — Event date.
- `event_time` ([DateTime](/docs/sql-reference/data-types/datetime)) — Event time.
- `event_time_microseconds` ([DateTime64](/docs/sql-reference/data-types/datetime64)) — Event time with microseconds resolution.

**Example**

```
SELECT * FROM system.metric_log LIMIT 1 FORMAT Vertical;
```

```
Row 1:
──────
hostname:                                                        clickhouse.eu-central1.internal
event_date:                                                      2020-09-05
event_time:                                                      2020-09-05 16:22:33
event_time_microseconds:                                         2020-09-05 16:22:33.196807
milliseconds:                                                    196
ProfileEvent_Query:                                              0
ProfileEvent_SelectQuery:                                        0
ProfileEvent_InsertQuery:                                        0
ProfileEvent_FailedQuery:                                        0
ProfileEvent_FailedSelectQuery:                                  0
...
...
CurrentMetric_Revision:                                          54439
CurrentMetric_VersionInteger:                                    20009001
CurrentMetric_RWLockWaitingReaders:                              0
CurrentMetric_RWLockWaitingWriters:                              0
CurrentMetric_RWLockActiveReaders:                               0
CurrentMetric_RWLockActiveWriters:                               0
CurrentMetric_GlobalThread:                                      74
CurrentMetric_GlobalThreadActive:                                26
CurrentMetric_LocalThread:                                       0
CurrentMetric_LocalThreadActive:                                 0
CurrentMetric_DistributedFilesToInsert:                          0
```

**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.

**See also**

- [metric\_log setting](/docs/operations/server-configuration-parameters/settings#metric_log) — Enabling and disabling the setting.
- [system.asynchronous\_metrics](/docs/operations/system-tables/asynchronous_metrics) — Contains periodically calculated metrics.
- [system.events](/docs/operations/system-tables/events) — Contains a number of events that occurred.
- [system.metrics](/docs/operations/system-tables/metrics) — Contains instantly calculated metrics.
- [Monitoring](/docs/operations/monitoring) — Base concepts of ClickHouse monitoring.

Was this page helpful?