From 61bcf611c7ae49549c6bfbb31e969ab3a88dd0f7 Mon Sep 17 00:00:00 2001 From: shuiyisong Date: Thu, 6 Nov 2025 15:44:14 +0800 Subject: [PATCH 1/4] chore: remove unused jaeger header Signed-off-by: shuiyisong --- docs/user-guide/query-data/jaeger.md | 14 -------------- .../current/user-guide/query-data/jaeger.md | 14 -------------- 2 files changed, 28 deletions(-) diff --git a/docs/user-guide/query-data/jaeger.md b/docs/user-guide/query-data/jaeger.md index bf443232e6..72ccfc781f 100644 --- a/docs/user-guide/query-data/jaeger.md +++ b/docs/user-guide/query-data/jaeger.md @@ -55,17 +55,3 @@ You can refer to the [OpenTelemetry official documentation](https://opentelemetr 3. Use Grafana's Jaeger Explore to view the data: ![Jaeger Explore](/jaeger-explore.png) - -### Add Time Range for Getting Operations Endpoints - -By default, we don't add time range parameters for the `GET /api/operations` and `GET /api/services/{service}/operations` endpoints. When the volume of traces data is large, this may lead to long query times. You can add a time range parameter by setting the HTTP Header based on your specific scenario, for example: - -``` -x-greptime-jaeger-time-range-for-operations: 3 days -``` - -This indicates that only the Operations data from the past 3 days will be returned. - -This header can be set in the **HTTP Headers** of the Jaeger Data Source, for example: - -![Set HTTP Headers](/jaeger-http-header-for-time-range.jpg) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/jaeger.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/jaeger.md index 66e582ae14..1d8c80feb7 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/jaeger.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/jaeger.md @@ -55,17 +55,3 @@ const proxyConfig = { 3. 使用 Jaeger Explore 来查看数据: ![Jaeger Explore](/jaeger-explore.png) - -### 为获取 Operations 接口添加时间范围 - -默认地,我们没有为 `GET /api/operations` 和 `GET /api/services/{service}/operations` 添加时间范围参数,当 traces 数据量较大时,这可能会导致查询时间过长。此时你可以基于自己的场景以 HTTP Header 的形式添加时间范围参数,比如: - -``` -x-greptime-jaeger-time-range-for-operations: 3 days -``` - -这表示只返回最近 3 天的 Operations 数据。 - -这个 Header 可设置在 Jaeger Data Source 的 **HTTP Headers** 中,比如: - -![设置 HTTP Headers](/jaeger-http-header-for-time-range.jpg) From 1dd774db24da16696d6747b431ad71fed6831c08 Mon Sep 17 00:00:00 2001 From: shuiyisong Date: Thu, 6 Nov 2025 16:32:21 +0800 Subject: [PATCH 2/4] chore: add recommend to grafana's plugin Signed-off-by: shuiyisong --- docs/user-guide/query-data/jaeger.md | 2 +- .../current/user-guide/query-data/jaeger.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/query-data/jaeger.md b/docs/user-guide/query-data/jaeger.md index 72ccfc781f..43c5c7aaf9 100644 --- a/docs/user-guide/query-data/jaeger.md +++ b/docs/user-guide/query-data/jaeger.md @@ -18,7 +18,7 @@ GreptimeDB currently supports the following [Jaeger](https://www.jaegertracing.i - `/api/services/{service}/operations`: Get all operations for a service. - `/api/traces`: Get traces by query parameters. -You can use [Grafana's Jaeger plugin](https://grafana.com/docs/grafana/latest/datasources/jaeger/) or [Jaeger UI](https://github.com/jaegertracing/jaeger-ui) to query traces data in GreptimeDB. When using Jaeger UI, you can set the `proxyConfig` in `packages/jaeger-ui/vite.config.mts` to the GreptimeDB address, for example: +You can use [Grafana's Jaeger plugin](https://grafana.com/docs/grafana/latest/datasources/jaeger/)(Recommended) or [Jaeger UI](https://github.com/jaegertracing/jaeger-ui) to query traces data in GreptimeDB. When using Jaeger UI, you can set the `proxyConfig` in `packages/jaeger-ui/vite.config.mts` to the GreptimeDB address, for example: ```ts const proxyConfig = { diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/jaeger.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/jaeger.md index 1d8c80feb7..e587816482 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/jaeger.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/jaeger.md @@ -18,7 +18,7 @@ GreptimeDB 目前支持以下 [Jaeger](https://www.jaegertracing.io/) 查询接 - `/api/services/{service}/operations`: 获取指定 Service 的所有 Operations。 - `/api/traces`: 根据查询参数获取 traces 数据。 -你可以使用 Grafana 的 [Jaeger 插件](https://grafana.com/docs/grafana/latest/datasources/jaeger/) 或者 [Jaeger UI](https://github.com/jaegertracing/jaeger-ui) 来查询 GreptimeDB 中的 traces 数据。当你在使用 Jaeger UI 的时候,可将 `packages/jaeger-ui/vite.config.mts` 的 `proxyConfig` 配置为 GreptimeDB 的地址,比如: +你可以使用 Grafana 的 [Jaeger 插件](https://grafana.com/docs/grafana/latest/datasources/jaeger/)(推荐) 或者 [Jaeger UI](https://github.com/jaegertracing/jaeger-ui) 来查询 GreptimeDB 中的 traces 数据。当你在使用 Jaeger UI 的时候,可将 `packages/jaeger-ui/vite.config.mts` 的 `proxyConfig` 配置为 GreptimeDB 的地址,比如: ```ts const proxyConfig = { From e5a61e183a6a19ef2eec45c90c2a2d79bc430b7a Mon Sep 17 00:00:00 2001 From: shuiyisong Date: Thu, 6 Nov 2025 17:22:30 +0800 Subject: [PATCH 3/4] chore: update note in traces Signed-off-by: shuiyisong --- docs/user-guide/ingest-data/for-observability/opentelemetry.md | 3 ++- .../user-guide/ingest-data/for-observability/opentelemetry.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/ingest-data/for-observability/opentelemetry.md b/docs/user-guide/ingest-data/for-observability/opentelemetry.md index 895afdd931..f1a14a790d 100644 --- a/docs/user-guide/ingest-data/for-observability/opentelemetry.md +++ b/docs/user-guide/ingest-data/for-observability/opentelemetry.md @@ -280,7 +280,8 @@ GreptimeDB will map the OTLP traces data model to the following table schema: - Resource attributes and span attributes are automatically flattened into separate columns, with column names being their JSON keys (using `.` to connect multiple levels of nesting) - `span_events` and `span_links` are stored as JSON data types by default -By default, the table is partitioned into 16 uniform regions based on the `trace_id` to efficiently store and query all trace data. +Note: +1. The `greptime_trace_v1` process uses the `trace_id` field to divide data into partitions for better performance. **Please make sure the first letter of the `trace_id` is evenly distributed**. ### Append Only diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-observability/opentelemetry.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-observability/opentelemetry.md index cdfa2e0cbb..f0968c4064 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-observability/opentelemetry.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-observability/opentelemetry.md @@ -283,7 +283,8 @@ OTLP traces 数据模型根据以下规则映射到 GreptimeDB 数据模型: - Resource Attributes 和 Span Attributes 将被自动展平为单独的列,列名为其 JSON 格式表示时的 key(多层嵌套时将用 `.` 连接); - `span_events` 和 `span_links` 默认存储为 JSON 数据类型; -默认地,表会根据 `trace_id` 均匀划分为 16 个 Region 以高效地存储和查询所有的 traces 数据。 +注意: +1. `greptime_trace_v1` 处理方式默认通过 `trace_id` 字段将数据切分成不同的分区以提升性能。**请确保 `trace_id` 的第一个字符是分布均匀的**。 ### Append 模式 From adcdb91114ef96463e7ef2c7ae0f826cf27cef9d Mon Sep 17 00:00:00 2001 From: shuiyisong Date: Thu, 6 Nov 2025 19:36:59 +0800 Subject: [PATCH 4/4] chore: add tips for ttl Signed-off-by: shuiyisong --- docs/user-guide/ingest-data/for-observability/opentelemetry.md | 1 + .../user-guide/ingest-data/for-observability/opentelemetry.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/user-guide/ingest-data/for-observability/opentelemetry.md b/docs/user-guide/ingest-data/for-observability/opentelemetry.md index f1a14a790d..f81e6b6b20 100644 --- a/docs/user-guide/ingest-data/for-observability/opentelemetry.md +++ b/docs/user-guide/ingest-data/for-observability/opentelemetry.md @@ -282,6 +282,7 @@ GreptimeDB will map the OTLP traces data model to the following table schema: Note: 1. The `greptime_trace_v1` process uses the `trace_id` field to divide data into partitions for better performance. **Please make sure the first letter of the `trace_id` is evenly distributed**. +2. For non-test scenarios, you might want to set a `ttl` to the trace table to avoid data overload. Set the HTTP header `x-greptime-hints: ttl=7d` would set a `ttl` of 7 days during the table creation, see [here](/reference/sql/create.md#table-options) for more details about `ttl` in table option. ### Append Only diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-observability/opentelemetry.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-observability/opentelemetry.md index f0968c4064..a78f3dc36e 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-observability/opentelemetry.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-observability/opentelemetry.md @@ -285,6 +285,7 @@ OTLP traces 数据模型根据以下规则映射到 GreptimeDB 数据模型: 注意: 1. `greptime_trace_v1` 处理方式默认通过 `trace_id` 字段将数据切分成不同的分区以提升性能。**请确保 `trace_id` 的第一个字符是分布均匀的**。 +2. 在非测试的场合下,可以通过设置 `ttl` 以避免持久化数据量过大。通过设置 `x-greptime-hints: ttl=7d` HTTP 请求头,在创建 trace 表时会添加一个 7 天的 `ttl` 表选项。见[此文档](/reference/sql/create.md#表选项)了解更多关于表选项 `ttl` 的信息。 ### Append 模式