diff --git a/.gitignore b/.gitignore index 5b5487a3d5..3cd0d666d0 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ tmp # User context files for AI assistant tools .context/* !.context/README.md +.task.md # External repos .ext/* diff --git a/content/shared/influxdb3-cli/config-options.md b/content/shared/influxdb3-cli/config-options.md index 46796551ca..3723912dd1 100644 --- a/content/shared/influxdb3-cli/config-options.md +++ b/content/shared/influxdb3-cli/config-options.md @@ -832,7 +832,92 @@ Sets the endpoint of an S3-compatible, HTTP/2-enabled object store cache. #### log-filter -Sets the filter directive for logs. +Sets the filter directive for logs. Use this option to control the verbosity of +server logs globally or for specific components. + +##### Log levels + +The following log levels are available (from least to most verbose): + +| Level | Description | +| :------ | :---------------------------------------------------------------------------------------------------- | +| `error` | Only errors | +| `warn` | Warnings and errors | +| `info` | Informational messages, warnings, and errors _(default)_ | +| `debug` | Debug information for troubleshooting, plus all above levels | +| `trace` | Very detailed tracing information, plus all above levels (produces high log volume) | + +##### Basic usage + +To set the log level globally, pass one of the log levels: + + + +```sh +influxdb3 serve --log-filter debug +``` + +##### Targeted filtering + +Globally enabling `debug` or `trace` produces a high volume of log output. +For more targeted debugging, you can set different log levels for specific +components using the format `,=`. + +###### Debug write buffer operations + + + +```sh +influxdb3 serve --log-filter info,influxdb3_write_buffer=debug +``` + +###### Trace WAL operations + + + +```sh +influxdb3 serve --log-filter info,influxdb3_wal=trace +``` + +###### Multiple targeted filters + + + +```sh +influxdb3 serve --log-filter info,influxdb3_write_buffer=debug,influxdb3_wal=debug +``` + +{{% show-in "enterprise" %}} + +###### Debug Enterprise storage engine operations + + + +```sh +influxdb3 serve --log-filter info,influxdb3_pacha_tree=debug +``` + +{{% /show-in %}} + +##### Common component names + +The following are common component names you can use for targeted filtering: + +| Component | Description | +| :------------------------------------ | :------------------------------------------------------- | +| `influxdb3_write_buffer` | Write buffer operations | +| `influxdb3_wal` | Write-ahead log operations | +| `influxdb3_catalog` | Catalog and schema operations | +| `influxdb3_cache` | Caching operations | +{{% show-in "enterprise" %}}`influxdb3_pacha_tree` | Enterprise storage engine operations | +`influxdb3_enterprise` | Enterprise-specific features | +{{% /show-in %}} + +> [!Note] +> Targeted filtering requires knowledge of the codebase component names. +> The component names correspond to Rust package names in the InfluxDB 3 source +> code. Use `debug` or `trace` sparingly on specific components to avoid +> excessive log output. | influxdb3 serve option | Environment variable | | :--------------------- | :------------------- | diff --git a/content/shared/influxdb3-write-guides/troubleshoot.md b/content/shared/influxdb3-write-guides/troubleshoot.md index 4b998e1523..bd4430cd05 100644 --- a/content/shared/influxdb3-write-guides/troubleshoot.md +++ b/content/shared/influxdb3-write-guides/troubleshoot.md @@ -6,7 +6,8 @@ Learn how to avoid unexpected results and recover from errors when writing to - [Review HTTP status codes](#review-http-status-codes) - [Troubleshoot failures](#troubleshoot-failures) - [Troubleshoot rejected points](#troubleshoot-rejected-points) -{{% show-in "core,enterprise" %}}- [Troubleshoot write performance issues](#troubleshoot-write-performance-issues){{% /show-in %}} +{{% show-in "core,enterprise" %}}- [Troubleshoot write performance issues](#troubleshoot-write-performance-issues) + - [Use debug logs for troubleshooting](#use-debug-logs-for-troubleshooting){{% /show-in %}} ## Handle write responses @@ -105,4 +106,28 @@ influxdb3 serve \ Replace {{% code-placeholder-key %}}`PERCENTAGE`{{% /code-placeholder-key %}} with the percentage of available memory to allocate (for example, `35%` for write-heavy workloads). +### Use debug logs for troubleshooting + +For deeper investigation of write issues, enable debug logging for specific +components. Debug logs provide detailed information about write buffer +operations and WAL activity. + +To enable debug logs for write operations, restart {{% product-name %}} with +targeted log filters: + + + +```sh +influxdb3 serve --log-filter info,influxdb3_write_buffer=debug +``` + + + +```sh +influxdb3 serve --log-filter info,influxdb3_wal=debug +``` + +For more information about log levels and targeted filtering, see +[log-filter configuration](/influxdb3/version/reference/config-options/#log-filter). + {{% /show-in %}}