MCPcopy Create free account
hub / github.com/Effect-TS/effect / span

Function span

packages/effect/src/unstable/devtools/DevToolsClient.ts:185–209  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

183
184 return Tracer.make({
185 span(options) {
186 const span = currentTracer.span(options)
187 // the span is mutated in place, so send a snapshot of its current state
188 client.sendUnsafe({ ...span })
189 const oldEvent = span.event
190 span.event = function(this: Tracer.Span, name, startTime, attributes) {
191 client.sendUnsafe({
192 _tag: "SpanEvent",
193 traceId: span.traceId,
194 spanId: span.spanId,
195 name,
196 startTime,
197 attributes
198 })
199 return oldEvent.call(this, name, startTime, attributes)
200 }
201
202 const oldEnd = span.end
203 span.end = function(this: Tracer.Span, endTime, exit) {
204 oldEnd.call(this, endTime, exit)
205 client.sendUnsafe({ ...span })
206 }
207
208 return span
209 },
210 context: currentTracer.context
211 })
212})

Callers

nothing calls this directly

Calls 1

spanMethod · 0.80

Tested by

no test coverage detected