Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ 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**.
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

Expand Down
16 changes: 1 addition & 15 deletions docs/user-guide/query-data/jaeger.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ 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` 的第一个字符是分布均匀的**。
2. 在非测试的场合下,可以通过设置 `ttl` 以避免持久化数据量过大。通过设置 `x-greptime-hints: ttl=7d` HTTP 请求头,在创建 trace 表时会添加一个 7 天的 `ttl` 表选项。见[此文档](/reference/sql/create.md#表选项)了解更多关于表选项 `ttl` 的信息。

### Append 模式

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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)