diff --git a/docs/reference/http-endpoints.md b/docs/reference/http-endpoints.md index 2ce4678bd..40f5ad7b0 100644 --- a/docs/reference/http-endpoints.md +++ b/docs/reference/http-endpoints.md @@ -111,6 +111,29 @@ This dashboard is packaged with the GreptimeDB server and provides a user-friend For more information, refer to the [how-to documentation](https://github.com/GreptimeTeam/greptimedb/blob/main/docs/how-to/how-to-change-log-level-on-the-fly.md). +### Enable/Disable Trace + +- **Path**: `/debug/enable_trace` +- **Methods**: `POST` +- **Description**: Dynamically enables or disables distributed tracing at runtime. +- **Usage**: Send `true` to enable tracing or `false` to disable tracing. + +Example to enable tracing: + +```bash +curl --data "true" http://127.0.0.1:4000/debug/enable_trace +# Output: trace enabled +``` + +Example to disable tracing: + +```bash +curl --data "false" http://127.0.0.1:4000/debug/enable_trace +# Output: trace disabled +``` + +For more information on tracing configuration, refer to the [tracing documentation](/user-guide/deployments-administration/monitoring/tracing.md). + ### Profiling Tools - **Base Path**: `/debug/prof/` diff --git a/docs/user-guide/deployments-administration/monitoring/tracing.md b/docs/user-guide/deployments-administration/monitoring/tracing.md index 2d0db63c8..866736288 100644 --- a/docs/user-guide/deployments-administration/monitoring/tracing.md +++ b/docs/user-guide/deployments-administration/monitoring/tracing.md @@ -9,6 +9,24 @@ GreptimeDB supports distributed tracing. GreptimeDB exports all collected spans In the [logging section](/user-guide/deployments-administration/configuration.md#logging-options) in the configuration, there are descriptions of configuration items related to tracing, [standalone.example.toml](https://github.com/GreptimeTeam/greptimedb/blob/VAR::greptimedbVersion/config/standalone.example.toml) provide a reference configuration in the logging section. +## Dynamic Tracing Control + +GreptimeDB provides the ability to enable or disable tracing dynamically at runtime using the HTTP API without requiring a server restart. This is useful for troubleshooting production issues or temporarily enabling tracing for debugging purposes. + +To enable tracing: + +```bash +curl --data "true" http://127.0.0.1:4000/debug/enable_trace +# Output: trace enabled +``` + +To disable tracing: + +```bash +curl --data "false" http://127.0.0.1:4000/debug/enable_trace +# Output: trace disabled +``` + ## Tutorial: Use Jaeger to trace GreptimeDB [Jaeger](https://www.jaegertracing.io/) is an open source, end-to-end distributed tracing system, originally developed and open sourced by Uber. Its goal is to help developers monitor and debug the request flow in complex microservice architectures.