Skip to content

Commit 6dd26ff

Browse files
committed
📝 add a sample about how to retrieve trace_id
1 parent 830b83f commit 6dd26ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ async fn shutdown_signal() {
6969
}
7070
```
7171

72+
To retrieve the current `trace_id` (eg to add it into error message (as header or attributes))
73+
74+
```rust
75+
let trace_id = axum_tracing_opentelemetry::find_current_trace_id();
76+
json!({ "error" : "xxxxxx", "trace_id": trace_id})
77+
```
78+
7279
## History
7380

7481
### 0.2.0

0 commit comments

Comments
 (0)