-
Notifications
You must be signed in to change notification settings - Fork 325
Add documentation for query log in cloud dedicated #6866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+154
−0
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
46ae716
Add documentation for viewing the query log in the Admin UI and using…
ritwika314 fe0c4de
Update content/influxdb3/cloud-dedicated/query-data/troubleshoot-and-…
jstirnaman 0640304
Update content/influxdb3/cloud-dedicated/query-data/troubleshoot-and-…
jstirnaman 6282ae4
Update content/influxdb3/cloud-dedicated/query-data/troubleshoot-and-…
jstirnaman 8e32328
Replace deprecated code-placeholders shortcode with placeholders attr…
Copilot 825c21b
Fix support.influxdata.com link pattern in query-log.md (#6867)
Copilot f0a7625
Update content/influxdb3/cloud-dedicated/query-data/troubleshoot-and-…
ritwika314 898c001
Apply suggestions from code review
ritwika314 7f9c741
Clarify note on query log enabling and its impact on cluster load per…
ritwika314 32d7ce4
Merge branch 'master' into ritwika/query_log
ritwika314 e8e5607
Add schema table with explicit data types for query_log fields (#6868)
Copilot 442ade5
Update content/influxdb3/cloud-dedicated/query-data/troubleshoot-and-…
jstirnaman f80f0e3
Update content/influxdb3/cloud-dedicated/query-data/troubleshoot-and-…
jstirnaman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
154 changes: 154 additions & 0 deletions
154
...ent/influxdb3/cloud-dedicated/query-data/troubleshoot-and-optimize/query-log.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| --- | ||
| title: View the query log | ||
| description: > | ||
| View and analyze queries executed on your cluster using the Admin UI Query History | ||
| or by querying the _internal database with influxctl. | ||
| menu: | ||
| influxdb3_cloud_dedicated: | ||
| name: View the query log | ||
| parent: Troubleshoot and optimize queries | ||
| weight: 351 | ||
| influxdb3/cloud-dedicated/tags: [query, observability, admin] | ||
| related: | ||
| - /influxdb3/cloud-dedicated/reference/cli/influxctl/query/ | ||
| - /influxdb3/cloud-dedicated/admin/account/ | ||
| - /influxdb3/cloud-dedicated/query-data/troubleshoot-and-optimize/system-information/ | ||
| --- | ||
|
|
||
| The query log records queries executed on your {{% product-name %}} cluster. | ||
| Use it to monitor query performance, find slow-running queries, and troubleshoot failed executions. | ||
|
|
||
| > [!Note] | ||
| > #### Query logging is not enabled by default | ||
| > | ||
| > The query log is disabled by default on all clusters because it generates additional ingest and storage overhead and is intended primarily for troubleshooting, not continuous monitoring. | ||
| > To enable it for your cluster, [contact InfluxData support](https://support.influxdata.com). | ||
|
|
||
| Use the Admin UI or the [`influxctl query` command](/influxdb3/cloud-dedicated/reference/cli/influxctl/query/) to view the query log. | ||
|
|
||
| {{< tabs-wrapper >}} | ||
| {{% tabs %}} | ||
| [Admin UI](#) | ||
| [influxctl](#) | ||
| {{% /tabs %}} | ||
| {{% tab-content %}} | ||
| {{< admin-ui-access >}} | ||
|
|
||
| 3. Open the cluster you want to inspect and go to **Query History**. | ||
|
|
||
| If query logging is enabled for your cluster, any admin user can access the query log in the Admin UI automatically; no database token is required. | ||
|
|
||
|
|
||
| In Query History you can: | ||
|
|
||
| - **Search** by Database Token ID to see queries run with a specific token. | ||
| - **Filter** by: | ||
| - **Status** (for example, success, failure) | ||
| - **Database** | ||
| - **Query type** (for example, SQL, InfluxQL) | ||
| - **Source** (for example, User Queries, UI) | ||
| - **Time range** (for example, last 24 hours) | ||
|
|
||
| The table lists each query with its status, query text, database, query type, duration, and timestamp. | ||
| You can use the column headers to sort (for example by duration or time). | ||
|
|
||
|
|
||
| <!-- vale Vale.Terms = NO --> | ||
| {{< img-hd src="/img/influxdb3/cloud-dedicated-admin-ui-query-log-list-view.png" alt="Query History list view in the Admin UI with search, filters, and table" />}} | ||
|
|
||
|
|
||
|
|
||
| You can also expand a row to see more details about that execution. | ||
|
|
||
|
|
||
| <!-- vale Vale.Terms = NO --> | ||
| {{< img-hd src="/img/influxdb3/cloud-dedicated-admin-ui-query-log-detail-view.png" alt="Query History detail view in the Admin UI" />}} | ||
|
|
||
| {{% /tab-content %}} | ||
| {{% tab-content %}} | ||
|
|
||
| <!------------------------------- BEGIN INFLUXCTL -----------------------------> | ||
|
|
||
| Use the [`influxctl query` command](/influxdb3/cloud-dedicated/reference/cli/influxctl/query/) | ||
| to run SQL against the `_internal` database and `query_log` table. | ||
| Query log entries are stored in the `_internal` database. | ||
|
|
||
| 1. If you haven't already, [download and install the `influxctl` CLI](/influxdb3/cloud-dedicated/reference/cli/influxctl/#download-and-install-influxctl), and then [configure an `influxctl` connection profile](/influxdb3/cloud-dedicated/reference/cli/influxctl/#configure-connection-profiles) for your cluster. | ||
| 2. [Create a database token](/influxdb3/cloud-dedicated/admin/tokens/database/create/?t=influxctl) that has read access to the `_internal` database. | ||
| Replace {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}} in the examples below with your {{% token-link "database" %}}. | ||
| 3. Run the **query** subcommand with `--database` and `--language` (and optionally `--config`). | ||
| Global flags such as `--config` must come before the command; query flags such as `--database`, `--language`, and `--token` must come after `query`. | ||
|
|
||
| #### Examples | ||
|
|
||
| **List recent successful queries with compute duration above a threshold (for example, 0.6 ms):** | ||
|
|
||
| ```sh { placeholders="DATABASE_TOKEN" } | ||
| influxctl query \ | ||
| --token DATABASE_TOKEN \ | ||
| --database _internal \ | ||
| --language sql \ | ||
| 'SELECT * FROM query_log WHERE success = '\''true'\'' AND compute_duration_ns > 600000 LIMIT 10' | ||
| ``` | ||
|
|
||
|
|
||
| **Filter by namespace (database) and time range:** | ||
|
|
||
| ```sh { placeholders="DATABASE_TOKEN" } | ||
| influxctl query \ | ||
| --token DATABASE_TOKEN \ | ||
| --database _internal \ | ||
| --language sql \ | ||
| 'SELECT * FROM query_log WHERE namespace_name = '\''my_database'\'' AND time >= now() - INTERVAL '\''1 day'\'' LIMIT 50' | ||
| ``` | ||
|
|
||
| **Example output:** | ||
|
|
||
| ``` | ||
| | auth_id | compute_duration_ns | phase | query_type | query_text | success | time | | ||
| |----------------|---------------------|---------|------------|---------------------------------------------------------|---------|--------------------------| | ||
| | token-id-xxxx | 2314333 | success | sql | SELECT * FROM query_log WHERE success = 'true' AND ... | true | 2026-02-25T00:30:30Z | | ||
| | token-id-yyyy | 3673637621 | success | sql | SELECT * FROM my_measurement WHERE time > now() - ... | true | 2026-02-25T00:28:57Z | | ||
| | token-id-yyyy | 1443145654 | success | sql | SELECT COUNT(*) FROM query_log WHERE ... | true | 2026-02-25T00:29:02Z | | ||
| +----------------+---------------------+---------+------------+---------------------------------------------------------+---------+--------------------------+ | ||
| ``` | ||
|
|
||
| <!-------------------------------- END INFLUXCTL ------------------------------> | ||
| {{% /tab-content %}} | ||
| {{< /tabs-wrapper >}} | ||
|
|
||
| ## Query log data and columns | ||
|
|
||
| The `query_log` table in `_internal` includes the following columns: | ||
|
|
||
| | Column | Data type | Description | | ||
| | :----- | :-------- | :---------- | | ||
| | **time** | timestamp | Timestamp when the query log entry was recorded | | ||
| | **id** | string | Unique identifier for the query | | ||
| | **namespace_id** | string | Internal identifier for the database | | ||
| | **namespace_name** | string | Name of the database where the query was executed | | ||
| | **query_type** | string | Type of query syntax used (`sql`, `influxql`) | | ||
| | **query_text** | string | The actual query statement text | | ||
| | **query_params** | string | Query parameters (if applicable) | | ||
| | **auth_id** | string | Database token ID used to authenticate the query | | ||
| | **trace_id** | string | Trace ID for debugging and monitoring | | ||
| | **success** | string | Query execution status (`'true'` or `'false'` as string) | | ||
| | **running** | string | Indicates if query is currently running (`'true'` or `'false'` as string) | | ||
| | **phase** | string | Current query phase (for example, `received`, `planned`, `permit`, `success`, `fail`, `cancel`) | | ||
| | **query_issue_time_ns** | int64 | Time when the query was issued (nanoseconds) | | ||
| | **permit_duration_ns** | int64 | Time spent waiting for query permit (nanoseconds) | | ||
| | **plan_duration_ns** | int64 | Time spent planning the query (nanoseconds) | | ||
| | **execute_duration_ns** | int64 | Time spent executing the query (nanoseconds) | | ||
| | **end_to_end_duration_ns** | int64 | Total end-to-end query duration (nanoseconds) | | ||
| | **compute_duration_ns** | int64 | Compute time for the query (nanoseconds) | | ||
| | **partition_count** | int64 | Number of partitions accessed | | ||
| | **parquet_file_count** | int64 | Number of Parquet files read | | ||
| | **max_memory_bytes** | int64 | Maximum memory used during query execution (bytes) | | ||
|
|
||
|
|
||
| > [!Note] | ||
| > #### Use string literals for status columns | ||
| > | ||
| > In the `query_log` table, `success` and `running` are stored as strings (`'true'` or `'false'`), not booleans. | ||
| > In SQL predicates, use string comparison—for example, `success = 'true'` or `running = 'false'`—to avoid type coercion errors. | ||
|
|
||
Binary file added
BIN
+552 KB
static/img/influxdb3/cloud-dedicated-admin-ui-query-log-detail-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.