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/4] 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/4] 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/4] 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. From b700b30188e06594b44dbeffc0d9050a456dac6b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 08:22:33 +0000 Subject: [PATCH 4/4] Add Chinese translations for dynamic trace enable/disable documentation Co-authored-by: waynexia <15380403+waynexia@users.noreply.github.com> --- .../current/reference/http-endpoints.md | 23 +++++++++++++++++++ .../monitoring/tracing.md | 18 +++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/reference/http-endpoints.md b/i18n/zh/docusaurus-plugin-content-docs/current/reference/http-endpoints.md index 27c6629061..10eecbdb9a 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/reference/http-endpoints.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/reference/http-endpoints.md @@ -111,6 +111,29 @@ is_strict_mode = false 有关更多信息,请参阅[如何文档](https://github.com/GreptimeTeam/greptimedb/blob/main/docs/how-to/how-to-change-log-level-on-the-fly.md)。 +### 启用/禁用链路追踪 + +- **路径**: `/debug/enable_trace` +- **方法**: `POST` +- **描述**: 在运行时动态启用或禁用分布式链路追踪。 +- **用法**: 发送 `true` 启用链路追踪,或发送 `false` 禁用链路追踪。 + +启用链路追踪示例: + +```bash +curl --data "true" http://127.0.0.1:4000/debug/enable_trace +# 输出: trace enabled +``` + +禁用链路追踪示例: + +```bash +curl --data "false" http://127.0.0.1:4000/debug/enable_trace +# 输出: trace disabled +``` + +有关链路追踪配置的更多信息,请参阅[链路追踪文档](/user-guide/deployments-administration/monitoring/tracing.md)。 + ### 性能分析工具 - **基础路径**: `/debug/prof/` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/monitoring/tracing.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/monitoring/tracing.md index 72a1a00ba2..b86fedcabb 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/monitoring/tracing.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/monitoring/tracing.md @@ -9,6 +9,24 @@ GreptimeDB 支持分布式链路追踪。GreptimeDB 使用基于 gRPC 的 OTLP 在配置中的 [logging 部分](/user-guide/deployments-administration/configuration.md#logging-选项) 有对 tracing 的相关配置项说明,[standalone.example.toml](https://github.com/GreptimeTeam/greptimedb/blob/VAR::greptimedbVersion/config/standalone.example.toml) 的 logging 部分提供了参考配置项。 +## 动态链路追踪控制 + +GreptimeDB 提供了通过 HTTP API 在运行时动态启用或禁用链路追踪的功能,无需重启服务器。这对于排查生产环境问题或临时启用追踪进行调试非常有用。 + +启用链路追踪: + +```bash +curl --data "true" http://127.0.0.1:4000/debug/enable_trace +# 输出: trace enabled +``` + +禁用链路追踪: + +```bash +curl --data "false" http://127.0.0.1:4000/debug/enable_trace +# 输出: trace disabled +``` + ## 教程:使用 Jaeger 追踪 GreptimeDB 调用链路 [Jaeger](https://www.jaegertracing.io/) 是一个开源的、端到端的分布式链路追踪系统,最初由 Uber 开发并开源。它的目标是帮助开发人员监测和调试复杂的微服务架构中的请求流程。