Help wanted!

The following content of this documentation page has been machine-translated. But unlike other websites, it is not done on the fly. This translated text lives on GitHub repository alongside main ClickHouse codebase and waits for fellow native speakers to make it more human-readable. You can also use the original English version as a reference.

Help ClickHouse documentation by editing this page

系统。trace_log

包含采样查询探查器收集的堆栈跟踪。

ClickHouse创建此表时 trace_log 服务器配置部分被设置。 也是 query_profiler_real_time_period_nsquery_profiler_cpu_time_period_ns 应设置设置。

要分析日志,请使用 addressToLine, addressToSymboldemangle 内省功能。

列:

  • event_date (日期) — Date of sampling moment.

  • event_time (日期时间) — Timestamp of the sampling moment.

  • timestamp_ns (UInt64) — Timestamp of the sampling moment in nanoseconds.

  • revision (UInt32) — ClickHouse server build revision.

    通过以下方式连接到服务器 clickhouse-client,你看到的字符串类似于 Connected to ClickHouse server version 19.18.1 revision 54429.. 该字段包含 revision,但不是 version 的服务器。

  • timer_type (枚举8) — Timer type:

    • Real 表示挂钟时间。
    • CPU 表示CPU时间。
  • thread_number (UInt32) — Thread identifier.

  • query_id (字符串) — Query identifier that can be used to get details about a query that was running from the query_log 系统表.

  • trace (数组(UInt64)) — Stack trace at the moment of sampling. Each element is a virtual memory address inside ClickHouse server process.

示例

  1. SELECT * FROM system.trace_log LIMIT 1 \G
  1. Row 1:
  2. ──────
  3. event_date: 2019-11-15
  4. event_time: 2019-11-15 15:09:38
  5. revision: 54428
  6. timer_type: Real
  7. thread_number: 48
  8. query_id: acc4d61f-5bd1-4a3e-bc91-2180be37c915
  9. trace: [94222141367858,94222152240175,94222152325351,94222152329944,94222152330796,94222151449980,94222144088167,94222151682763,94222144088167,94222151682763,94222144088167,94222144058283,94222144059248,94222091840750,94222091842302,94222091831228,94222189631488,140509950166747,140509942945935]