From 132a7acdb41c0603c8edf504723620b336367682 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 17 Nov 2025 13:42:39 +0000 Subject: [PATCH 1/3] Initial plan From 212dbe8d31407bd25de2a6f6e3dce80d0c72b5ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 17 Nov 2025 13:51:45 +0000 Subject: [PATCH 2/3] Add documentation for dynamic trace enable/disable endpoint Co-authored-by: waynexia <15380403+waynexia@users.noreply.github.com> --- docs/reference/http-endpoints.md | 23 +++++++++++++++++++ .../monitoring/tracing.md | 20 ++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/docs/reference/http-endpoints.md b/docs/reference/http-endpoints.md index 2ce4678bd5..40f5ad7b06 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 2d0db63c89..c0a90eda30 100644 --- a/docs/user-guide/deployments-administration/monitoring/tracing.md +++ b/docs/user-guide/deployments-administration/monitoring/tracing.md @@ -9,6 +9,26 @@ 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 +``` + +For more details about this endpoint, refer to the [HTTP API endpoint list](/reference/http-endpoints.md#enabledisable-trace). + ## 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. From 7946b829f937b23cc628da9a45f3e29d3f94c6cc Mon Sep 17 00:00:00 2001 From: Ruihang Xia Date: Tue, 18 Nov 2025 11:16:32 +0800 Subject: [PATCH 3/3] Apply suggestion from @waynexia --- .../user-guide/deployments-administration/monitoring/tracing.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/user-guide/deployments-administration/monitoring/tracing.md b/docs/user-guide/deployments-administration/monitoring/tracing.md index c0a90eda30..8667362888 100644 --- a/docs/user-guide/deployments-administration/monitoring/tracing.md +++ b/docs/user-guide/deployments-administration/monitoring/tracing.md @@ -27,8 +27,6 @@ curl --data "false" http://127.0.0.1:4000/debug/enable_trace # Output: trace disabled ``` -For more details about this endpoint, refer to the [HTTP API endpoint list](/reference/http-endpoints.md#enabledisable-trace). - ## 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.