Effect CommunityEC
Effect Community2y ago
2 replies
Sly

Trouble with OpenTelemetry Spans in Pipe

Given a scenario with an already existing otel instrumentation (e.g. @microlabs/otel-cf-workers) should something such as:

            .pipe(
                    Effect.provide(LiveApp(env, context, request)),
                    Effect.withParentSpan(
                        Tracer.externalSpan({
                            // biome-ignore lint/style/noNonNullAssertion: We assume that there's already a span in the context
                            traceId: openTelemetryApi.trace.getActiveSpan()?.spanContext()
                                .traceId!,
                            // biome-ignore lint/style/noNonNullAssertion: We assume that there's already a span in the context
                            spanId: openTelemetryApi.trace.getActiveSpan()?.spanContext()
                                .spanId!,
                        }),
                    ),
                    Effect.tapError(Effect.logError),
                ),

work? Unfortunately not seeing the spans added.
Was this page helpful?