evanderkoogh / otel-cf-workers

An OpenTelemetry compatible library for instrumenting and exporting traces for Cloudflare Workers
BSD 3-Clause "New" or "Revised" License
239 stars 50 forks source link

how do you add custom log info for queue handler? #2

Closed ad6025b closed 1 year ago

ad6025b commented 1 year ago

how do you add custom log info for queue handler?

image

evanderkoogh commented 1 year ago

You should be able to get the current span by called trace.getActiveSpan()

Have a look at the example at: https://github.com/evanderkoogh/otel-cf-workers/blob/34700b4e6ca021a24c75150de44f9900f36e187c/examples/worker/src/index.ts#LL32C2-L32C59