ClickHouse/docs/en/operations/system-tables/trace_log.md
Anna a6fb067a75
DOCSUP-1915: Split system-table.md into separate files. (#13160)
* Corrected en files

* Split system-tables.md into separate files

* Fixed links.

* Fixed links.

* Fixed links.

* Fixed links.

* Add ref to original article

* Fixed links

* Add toc_folder_title and translate

* Add stack_trace.md, correct toc-title

* Fixed links

* Hypothesis testing

* Hypothesis testing

* Update run.sh, thanks @azat

Co-authored-by: Anna Devyatova <annadevyatova@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>
2020-08-06 11:50:29 +03:00

2.6 KiB

system.trace_log

Contains stack traces collected by the sampling query profiler.

ClickHouse creates this table when the trace_log server configuration section is set. Also the query_profiler_real_time_period_ns and query_profiler_cpu_time_period_ns settings should be set.

To analyze logs, use the addressToLine, addressToSymbol and demangle introspection functions.

Columns:

  • event_date (Date) — Date of sampling moment.

  • event_time (DateTime) — Timestamp of the sampling moment.

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

  • revision (UInt32) — ClickHouse server build revision.

    When connecting to server by clickhouse-client, you see the string similar to Connected to ClickHouse server version 19.18.1 revision 54429.. This field contains the revision, but not the version of a server.

  • timer_type (Enum8) — Timer type:

    • Real represents wall-clock time.
    • CPU represents CPU time.
  • thread_number (UInt32) — Thread identifier.

  • query_id (String) — Query identifier that can be used to get details about a query that was running from the query_log system table.

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

Example

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

Original article