Documentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Querying in ClickHouse CloudThe 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.Description
Contains stack traces collected by the sampling query profiler. ClickHouse creates this table when the trace_log server configuration section is set. Also see settings: query_profiler_real_time_period_ns, query_profiler_cpu_time_period_ns, memory_profiler_step, memory_profiler_sample_probability, trace_profile_events. To analyze logs, use theaddressToLine, addressToLineWithInlines, addressToSymbol and demangle introspection functions.
Columns
-
hostname(LowCardinality(String)) — Hostname of the server executing the query. -
event_date(Date) — Date of sampling moment. -
event_time(DateTime) — Timestamp of the sampling moment. -
event_time_microseconds(DateTime64) — Timestamp of the sampling moment with microseconds precision. -
timestamp_ns(UInt64) — Timestamp of the sampling moment in nanoseconds. -
revision(UInt32) — ClickHouse server build revision. When connecting to the server byclickhouse-client, you see the string similar toConnected to ClickHouse server version 19.18.1.. This field contains therevision, but not theversionof a server. -
trace_type(Enum8) — Trace type:Realrepresents collecting stack traces by wall-clock time.CPUrepresents collecting stack traces by CPU time.Memoryrepresents collecting allocations and deallocations when memory allocation exceeds the subsequent watermark.MemorySamplerepresents collecting random allocations and deallocations.MemoryPeakrepresents collecting updates of peak memory usage.ProfileEventrepresents collecting of increments of profile events.JemallocSamplerepresents collecting of jemalloc samples.MemoryAllocatedWithoutCheckrepresents collection of significant allocations (>16MiB) that is done with ignoring any memory limits (for ClickHouse developers only).Instrumentationrepresents traces collected by the instrumentation performed through XRay.
-
cpu_id(UInt64) — CPU identifier. -
thread_id(UInt64) — 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. -
size(Int64) - For trace typesMemory,MemorySampleorMemoryPeakis the amount of memory allocated, for other trace types is 0. -
event(LowCardinality(String)) - For trace typeProfileEventis the name of updated profile event, for other trace types is an empty string. -
increment(UInt64) - For trace typeProfileEventis the amount of increment of profile event, for other trace types is 0. -
symbols, (Array(LowCardinality(String))), If the symbolization is enabled, contains demangled symbol names, corresponding to thetrace. -
lines, (Array(LowCardinality(String))), If the symbolization is enabled, contains strings with file names with line numbers, corresponding to thetrace. -
function_id(Nullable(Int32)), For trace type Instrumentation, ID assigned to the function in xray_instr_map section of elf-binary. -
function_name(Nullable(String)), For trace type Instrumentation, name of the instrumented function. -
handler(Nullable(String)), For trace type Instrumentation, handler of the instrumented function. -
entry_type(Nullable(Enum(‘Entry’ = 0, ‘Exit’ = 1))), For trace type Instrumentation, entry type of the trace. -
duration_nanoseconds(Nullable(UInt64)), For trace type Instrumentation, time the function was running for in nanoseconds.
symbolize under trace_log in the server’s configuration file.
Example
Converting to Chrome Event Trace Format
The profiling data can be converted to Chrome’s Event Trace Format with the following query. Save the query to achrome_trace.sql file:
trace.json file that we can import either with Perfetto or speedscope.
See Also
- SYSTEM INSTRUMENT — Add or remove instrumentation points.
- system.instrumentation — Inspect instrumented points.
- system.symbols — Inspect symbols to add instrumentation points.