Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Song Gao <[email protected]>
  • Loading branch information
Yisaer committed Oct 11, 2024
1 parent 0014bf2 commit 7fa4b1f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/en_US/api/restapi/trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ eKuiper supports viewing recent tracing data of rules through API.

## Start trace the data of specific rule

Turn on the data tracing of the rules. The strategy supports `always` and `head`. `always` means that each message is always traced, and `head` means that only upstream messages containing trace context will be traced.

```shell
POST http://localhost:9081/rule/{ruleID}/trace/start

{
"strategy": "head"
}
```

## Stop trace the data of specific rule
Expand Down
6 changes: 6 additions & 0 deletions docs/zh_CN/api/restapi/trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ eKuiper 支持通过 API 查看规则最近的追踪数据。

## 开启特定规则的数据追踪

开启规则的数据追踪,strategy 支持 `always``head`. `always` 代表总是对每条消息进行追踪,`head` 代表只有上游消息含有 trace context 才会进行追踪。

```shell
POST http://localhost:9081/rule/{ruleID}/trace/start

{
"strategy": "head"
}
```

## 关闭特定规则的数据追踪
Expand Down
1 change: 0 additions & 1 deletion internal/io/neuron/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ func extractSpanContextIntoData(ctx api.StreamContext, data interface{}, sendByt
defer span.End()
traceID := span.SpanContext().TraceID()
spanID := span.SpanContext().SpanID()
defer span.End()
r := NeuronTraceHeader
r = append(r, traceID[:]...)
r = append(r, spanID[:]...)
Expand Down

0 comments on commit 7fa4b1f

Please sign in to comment.