You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/altinity-kb-queries-and-syntax/troubleshooting.md
+27-9Lines changed: 27 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,19 @@ description: >
7
7
8
8
Tips for ClickHouse® troubleshooting
9
9
10
-
##Log of query execution
10
+
### Query Execution Logging
11
11
12
-
Controlled by session level setting `send_logs_level`
12
+
When troubleshooting query execution in ClickHouse, one of the most useful tools is logging the query execution details. This can be controlled using the session-level setting `send_logs_level`. Here are the different log levels you can use:
13
13
Possible values: `'trace', 'debug', 'information', 'warning', 'error', 'fatal', 'none'`
14
-
Can be used with [clickhouse-client](https://docs.altinity.com/altinitycloud/altinity-cloud-connections/clickhouseclient/) in both interactive and non-interactive mode.
14
+
15
+
This can be used with [clickhouse-client](https://docs.altinity.com/altinitycloud/altinity-cloud-connections/clickhouseclient/) in both interactive and non-interactive mode.
16
+
17
+
The logs provide detailed information about query execution, making it easier to identify issues or bottlenecks. You can use the following command to run a query with logging enabled:
15
18
16
19
```bash
17
20
$ clickhouse-client -mn --send_logs_level='trace' --query "SELECT sum(number) FROM numbers(1000)"
21
+
22
+
-- output --
18
23
[LAPTOP] 2021.04.29 00:05:31.425842 [ 25316 ] {14b0646d-8a6e-4b2f-9b13-52a218cf43ba} <Debug> executeQuery: (from 127.0.0.1:42590, using production parser) SELECT sum(number) FROM numbers(1000)
WHERE (event_date = today()) AND (query_id ='34c61093-3303-47d0-860b-0d644fa7264b');
89
106
90
-
If opentelemetry_span_log enabled (SET opentelemetry_start_trace_probability =1, opentelemetry_trace_processors =1)
107
+
# OpenTelemetry Span Log: For detailed tracing with OpenTelemetry, if enabled (opentelemetry_start_trace_probability = 1), use:
108
+
# To enable OpenTelemetry tracing for queries, set: (SET opentelemetry_start_trace_probability = 1, opentelemetry_trace_processors = 1)
91
109
92
110
SELECT*
93
111
FROMsystem.opentelemetry_span_log
@@ -100,10 +118,9 @@ WHERE (trace_id, finish_date) IN (
100
118
);
101
119
```
102
120
121
+
### Visualizing Query Performance with Flamegraphs
103
122
104
-
105
-
## Flamegraph
106
-
123
+
ClickHouse supports exporting query performance data in a format compatible with speedscope.app. This can help you visualize performance bottlenecks within queries. Example query to generate a flamegraph:
0 commit comments