diff --git a/docs/en/cloud/images/sqlconsole/insights_drilldown.png b/docs/en/cloud/images/sqlconsole/insights_drilldown.png new file mode 100644 index 00000000000..3063dc50aef Binary files /dev/null and b/docs/en/cloud/images/sqlconsole/insights_drilldown.png differ diff --git a/docs/en/cloud/images/sqlconsole/insights_latency.png b/docs/en/cloud/images/sqlconsole/insights_latency.png new file mode 100644 index 00000000000..34e768dc013 Binary files /dev/null and b/docs/en/cloud/images/sqlconsole/insights_latency.png differ diff --git a/docs/en/cloud/images/sqlconsole/insights_overview.png b/docs/en/cloud/images/sqlconsole/insights_overview.png new file mode 100644 index 00000000000..12f5221a896 Binary files /dev/null and b/docs/en/cloud/images/sqlconsole/insights_overview.png differ diff --git a/docs/en/cloud/images/sqlconsole/insights_query_info.png b/docs/en/cloud/images/sqlconsole/insights_query_info.png new file mode 100644 index 00000000000..adbb15624c9 Binary files /dev/null and b/docs/en/cloud/images/sqlconsole/insights_query_info.png differ diff --git a/docs/en/cloud/images/sqlconsole/insights_recent.png b/docs/en/cloud/images/sqlconsole/insights_recent.png new file mode 100644 index 00000000000..35ec081553e Binary files /dev/null and b/docs/en/cloud/images/sqlconsole/insights_recent.png differ diff --git a/docs/en/get-started/query-insights.md b/docs/en/get-started/query-insights.md new file mode 100644 index 00000000000..f1399b29378 --- /dev/null +++ b/docs/en/get-started/query-insights.md @@ -0,0 +1,47 @@ +--- +sidebar_title: Query Insights +slug: /en/get-started/query-insights +description: Visualize system.query_log data to simplify query debugging and performance optimization +keywords: [query insights, query log, query log ui, system.query_log insights] +--- + +# Query Insights + +The **Query Insights** feature makes ClickHouse's built-in query log easier to use through various visualizations and tables. ClickHouse's `system.query_log` table is a key source of information for query optimization, debugging, and monitoring overall cluster health and performance. + +## Query Overview + +After selecting a service, the **Monitoring** navigation item in the left sidebar should expand to reveal a new **Query insights** sub-item. Clicking on this option opens the new Query insights page: + +![Query Insights UI Overview](@site/docs/en/cloud/images/sqlconsole/insights_overview.png) + +## Top-level metrics + +The stat boxes at the top represent some basic top-level query metrics over the selected period of time. Beneath it, we’ve exposed three time-series charts representing query volume, latency, and error rate broken down by query kind (select, insert, other) over a selected time window. The latency chart can be further adjusted to display p50, p90, and p99 latencies: + +![Query Insights UI Latency Chart](@site/docs/en/cloud/images/sqlconsole/insights_latency.png) + +## Recent queries + +Beneath the top-level metrics, a table displays query log entries (grouped by normalized query hash and user) over the selected time window: + +![Query Insights UI Recent Queries Table](@site/docs/en/cloud/images/sqlconsole/insights_recent.png) + +Recent queries can be filtered and sorted by any available field. The table can also be configured to display orhide additional fields such as tables, p90, and p99 latencies. + +## Query drill-down + +Selecting a query from the recent queries table will open a flyout containing metrics and information specific to the selected query: + +![Query Insights UI Query Drilldown](@site/docs/en/cloud/images/sqlconsole/insights_drilldown.png) + +As we can see from the flyout, this particular query has been run more than 3000 times in the last 24 hours. All metrics in the **Query info** tab are aggregated metrics, but we can also view metrics from individual runs by selecting the **Query history** tab: + +Query Insights UI Query Information + +
+ +From this pane, the `Settings` and `Profile Events` items for each query run can be expanded to reveal additional information. diff --git a/sidebars.js b/sidebars.js index c0fe3fc4bdb..e32f69e08e5 100644 --- a/sidebars.js +++ b/sidebars.js @@ -86,8 +86,8 @@ const sidebars = { ], }, { - type: 'category', - label: 'Migrations', + type: "category", + label: "Migrations", collapsed: false, collapsible: false, items: [ @@ -97,11 +97,11 @@ const sidebars = { "en/integrations/data-ingestion/dbms/mysql/index", "en/integrations/data-ingestion/redshift/index", { - type: 'doc', - id: 'en/integrations/migration/rockset', - label: 'Rockset' + type: "doc", + id: "en/integrations/migration/rockset", + label: "Rockset", }, - ] + ], }, { type: "category", @@ -109,16 +109,16 @@ const sidebars = { collapsed: false, collapsible: false, items: [ - 'en/data-modeling/schema-design', - 'en/dictionary/index', - 'en/materialized-view/index', + "en/data-modeling/schema-design", + "en/dictionary/index", + "en/materialized-view/index", { - type: 'doc', - label: 'Data Compression', - id: 'en/data-compression/compression-in-clickhouse' + type: "doc", + label: "Data Compression", + id: "en/data-compression/compression-in-clickhouse", }, - 'en/data-modeling/denormalization', - ] + "en/data-modeling/denormalization", + ], }, { type: "category", @@ -531,6 +531,7 @@ const sidebars = { id: "en/get-started/cloud-quick-start", }, "en/get-started/sql-console", + "en/get-started/query-insights", "en/get-started/query-endpoints", "en/cloud/marketplace", "en/cloud/support", @@ -572,7 +573,7 @@ const sidebars = { className: "top-nav-item", items: [ { - type: 'doc', + type: "doc", id: "en/cloud/manage/api/api-overview", }, "en/cloud/manage/openapi", @@ -626,41 +627,41 @@ const sidebars = { collapsible: false, className: "top-nav-item", items: [ - 'en/cloud/security/shared-responsibility-model', + "en/cloud/security/shared-responsibility-model", { type: "category", label: "Cloud Access Management", items: [ - 'en/cloud/security/cloud-access-management', - 'en/cloud/security/cloud-authentication', - 'en/cloud/security/saml-sso-setup', - 'en/cloud/security/common-access-management-queries' - ] + "en/cloud/security/cloud-access-management", + "en/cloud/security/cloud-authentication", + "en/cloud/security/saml-sso-setup", + "en/cloud/security/common-access-management-queries", + ], }, { type: "category", label: "Connectivity", items: [ - 'en/cloud/security/setting-ip-filters', + "en/cloud/security/setting-ip-filters", { type: "category", label: "Private Networking", items: [ - 'en/cloud/security/private-link-overview', - 'en/cloud/security/aws-privatelink', - 'en/cloud/security/gcp-private-service-connect', - 'en/cloud/security/azure-privatelink' - ] + "en/cloud/security/private-link-overview", + "en/cloud/security/aws-privatelink", + "en/cloud/security/gcp-private-service-connect", + "en/cloud/security/azure-privatelink", + ], }, - 'en/cloud/security/accessing-s3-data-securely', - 'en/cloud/security/cloud-endpoints-api' - ] + "en/cloud/security/accessing-s3-data-securely", + "en/cloud/security/cloud-endpoints-api", + ], }, - 'en/cloud/security/cmek', - 'en/cloud/security/audit-logging', + "en/cloud/security/cmek", + "en/cloud/security/audit-logging", { - type: 'category', - label: 'Privacy and Compliance', + type: "category", + label: "Privacy and Compliance", collapsed: true, collapsible: true, items: [ @@ -683,10 +684,10 @@ const sidebars = { "en/integrations/migration/object-storage-to-clickhouse", "en/integrations/migration/upload-a-csv-file", { - type: 'link', - label: 'Rockset', - href: '/en/migrations/rockset', - } + type: "link", + label: "Rockset", + href: "/en/migrations/rockset", + }, ], }, ], @@ -815,115 +816,121 @@ const sidebars = { }, ], - dictionary: [{ - type: "category", - label: "Dictionary", - collapsed: false, - collapsible: false, - items: [ - { - type: 'doc', - label: 'Overview', - id: 'en/dictionary/index', - }, - { - type: 'doc', - label: 'Advanced Configuration', - id: 'en/sql-reference/dictionaries/index', - }, - { - type: 'link', - label: 'Functions', - href: '/en/sql-reference/functions/ext-dict-functions' - }, - ] - }, - { - type: 'category', - label: 'SQL Reference', - collapsed: false, - collapsible: false, - items: [ - { - type: 'link', - label: 'Dictionary Table Engine', - href: '/en/engines/table-engines/special/dictionary' - }, - { - type: 'link', - label: 'CREATE DICTIONARY', - href: '/en/sql-reference/statements/create/dictionary' - }, - { - type: 'link', - label: 'DROP DICTIONARY', - href: '/en/sql-reference/statements/drop#drop-dictionary' - }, - ] - }], + dictionary: [ + { + type: "category", + label: "Dictionary", + collapsed: false, + collapsible: false, + items: [ + { + type: "doc", + label: "Overview", + id: "en/dictionary/index", + }, + { + type: "doc", + label: "Advanced Configuration", + id: "en/sql-reference/dictionaries/index", + }, + { + type: "link", + label: "Functions", + href: "/en/sql-reference/functions/ext-dict-functions", + }, + ], + }, + { + type: "category", + label: "SQL Reference", + collapsed: false, + collapsible: false, + items: [ + { + type: "link", + label: "Dictionary Table Engine", + href: "/en/engines/table-engines/special/dictionary", + }, + { + type: "link", + label: "CREATE DICTIONARY", + href: "/en/sql-reference/statements/create/dictionary", + }, + { + type: "link", + label: "DROP DICTIONARY", + href: "/en/sql-reference/statements/drop#drop-dictionary", + }, + ], + }, + ], - materializedView: [{ - type: "category", - label: "Materialized View", - collapsed: false, - collapsible: false, - items: [ - { - type: 'doc', - label: 'Overview', - id: 'en/materialized-view/index', - }, - { - type: 'doc', - label: 'Cascading Materialized View', - id: 'en/guides/developer/cascading-materialized-views', - }, - { - type: 'doc', - label: 'Refreshable Materialized View', - id: 'en/materialized-view/refreshable-materialized-view', - }, - ]}, + materializedView: [ { - type: 'category', - label: 'SQL Reference', + type: "category", + label: "Materialized View", collapsed: false, collapsible: false, items: [ { - type: 'link', - label: 'CREATE VIEW', - href: '/en/sql-reference/statements/create/view' + type: "doc", + label: "Overview", + id: "en/materialized-view/index", + }, + { + type: "doc", + label: "Cascading Materialized View", + id: "en/guides/developer/cascading-materialized-views", + }, + { + type: "doc", + label: "Refreshable Materialized View", + id: "en/materialized-view/refreshable-materialized-view", }, + ], + }, + { + type: "category", + label: "SQL Reference", + collapsed: false, + collapsible: false, + items: [ { - type: 'link', - label: 'DROP VIEW', - href: '/en/sql-reference/statements/drop#drop-view' + type: "link", + label: "CREATE VIEW", + href: "/en/sql-reference/statements/create/view", }, { - type: 'link', - label: 'REFRESH', - href: '/en/sql-reference/statements/create/view#refreshable-materialized-view' + type: "link", + label: "DROP VIEW", + href: "/en/sql-reference/statements/drop#drop-view", }, - ] - } + { + type: "link", + label: "REFRESH", + href: "/en/sql-reference/statements/create/view#refreshable-materialized-view", + }, + ], + }, ], - dataCompression: [{ - type: "category", - label: "Data Compression", - collapsed: false, - collapsible: false, - items: [ - 'en/data-compression/compression-in-clickhouse', - { - type: 'link', - label: 'Applying compression codecs', - href: '/en/sql-reference/statements/create/table#column_compression_codec' - }, - 'en/data-compression/compression-modes', - ] - }], + dataCompression: [ + { + type: "category", + label: "Data Compression", + collapsed: false, + collapsible: false, + items: [ + "en/data-compression/compression-in-clickhouse", + { + type: "link", + label: "Applying compression codecs", + href: "/en/sql-reference/statements/create/table#column_compression_codec", + }, + "en/data-compression/compression-modes", + ], + }, + ], chdb: [ { @@ -932,11 +939,7 @@ const sidebars = { className: "top-nav-item", collapsed: false, collapsible: false, - items: [ - 'en/chdb/index', - 'en/chdb/data-formats', - 'en/chdb/sql-reference', - ] + items: ["en/chdb/index", "en/chdb/data-formats", "en/chdb/sql-reference"], }, { type: "category", @@ -945,67 +948,67 @@ const sidebars = { collapsed: false, collapsible: false, items: [ - 'en/chdb/install/python', - 'en/chdb/install/nodejs', - 'en/chdb/install/go', - 'en/chdb/install/rust', - 'en/chdb/install/bun', - 'en/chdb/install/c', - ] + "en/chdb/install/python", + "en/chdb/install/nodejs", + "en/chdb/install/go", + "en/chdb/install/rust", + "en/chdb/install/bun", + "en/chdb/install/c", + ], }, { - type: 'category', + type: "category", label: "Integrations", className: "top-nav-item", collapsed: false, collapsible: false, items: [ { - type: 'link', - label: 'JupySQL', - href: 'https://jupysql.ploomber.io/en/latest/integrations/chdb.html' + type: "link", + label: "JupySQL", + href: "https://jupysql.ploomber.io/en/latest/integrations/chdb.html", }, { - type: 'link', - label: 'chdb-lambda', - href: 'https://github.com/chdb-io/chdb-lambda' + type: "link", + label: "chdb-lambda", + href: "https://github.com/chdb-io/chdb-lambda", }, { - type: 'link', - label: 'chdb-cli', - href: 'https://github.com/chdb-io/chdb-go?tab=readme-ov-file#chdb-go-cli' + type: "link", + label: "chdb-cli", + href: "https://github.com/chdb-io/chdb-go?tab=readme-ov-file#chdb-go-cli", }, - ] + ], }, { - type: 'category', + type: "category", label: "About chDB", className: "top-nav-item", collapsed: false, collapsible: false, items: [ { - type: 'link', - label: 'Discord', - href: 'https://discord.gg/Njw5YXSPPc' + type: "link", + label: "Discord", + href: "https://discord.gg/Njw5YXSPPc", }, { - type: 'link', - label: 'Birth of chDB', - href: 'https://auxten.com/the-birth-of-chdb/' + type: "link", + label: "Birth of chDB", + href: "https://auxten.com/the-birth-of-chdb/", }, { - type: 'link', - label: 'Joining ClickHouse, Inc.', - href: 'https://clickhouse.com/blog/welcome-chdb-to-clickhouse' + type: "link", + label: "Joining ClickHouse, Inc.", + href: "https://clickhouse.com/blog/welcome-chdb-to-clickhouse", }, { - type: 'link', - label: 'Team and Contributors', - href: 'https://github.com/chdb-io/chdb#contributors' + type: "link", + label: "Team and Contributors", + href: "https://github.com/chdb-io/chdb#contributors", }, - ] - } + ], + }, ], russia: [