MCPcopy Create free account
hub / github.com/effect-app/libs / withRequestSpan

Function withRequestSpan

packages/effect-app/src/setupRequest.ts:42–57  ·  view source on GitHub ↗
(name = "request", options?: Tracer.SpanOptions)

Source from the content-addressed store, hash-verified

40})
41
42const withRequestSpan = (name = "request", options?: Tracer.SpanOptions) => <R, E, A>(f: Effect.Effect<A, E, R>) =>
43 Effect.andThen(
44 getRC,
45 (ctx) =>
46 f.pipe(
47 Effect.withSpan(name, {
48 ...options,
49 attributes: { ...spanAttributes({ ...ctx, name: NonEmptyString255(name) }), ...options?.attributes }
50 }, {
51 captureStackTrace: options?.captureStackTrace ?? false
52 }),
53 // TODO: false
54 // request context info is picked up directly in the logger for annotations.
55 Effect.withLogSpan(name)
56 )
57 )
58
59export interface SetupRequestOptions {
60 readonly withTransaction?: boolean

Calls 2

spanAttributesFunction · 0.90
pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…