Skip to content

Commit dc5361a

Browse files
committed
feat(worker): Provided module
1 parent 3800e59 commit dc5361a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

worker/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ func main() {
157157

158158
### Logging
159159

160+
You can use the [CtxLogger()](context.go) function to retrieve the
161+
contextual [log.Logger](https://github.com/ankorstore/yokai/tree/main/log) from your workers, and emit correlated logs.
162+
160163
The workers executions are logged, with the following fields added automatically to each log records:
161164

162165
- `worker`: worker name
@@ -203,11 +206,12 @@ func main() {
203206
}
204207
```
205208

206-
You can use the [CtxLogger()](context.go) function to retrieve the
207-
contextual [log.Logger](https://github.com/ankorstore/yokai/tree/main/log) from your workers, and emit correlated logs.
208-
209209
### Tracing
210210

211+
You can use the [CtxTracer()](context.go) function to retrieve the contextual tracer from your workers, and emit
212+
correlated spans: they will have the `Worker` and `WorkerExecutionID` attributes added with respectively the worker name
213+
and execution id.
214+
211215
This module provides the [AnnotateTracerProvider](trace.go) function, to extend
212216
a [TracerProvider](https://github.com/open-telemetry/opentelemetry-go/blob/main/sdk/trace/provider.go) to add
213217
automatically current worker information id to the spans emitted during a worker execution:
@@ -258,10 +262,6 @@ func main() {
258262
}
259263
```
260264

261-
You can use the [CtxTracer()](context.go) function to retrieve the contextual tracer from your workers, and emit
262-
correlated spans: they will have the `Worker` and `WorkerExecutionID` attributes added with respectively the worker name
263-
and execution id.
264-
265265
### Metrics
266266

267267
The [WorkerPool](pool.go) automatically generate metrics about:

0 commit comments

Comments
 (0)