© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Issue with `traceFlags` Not Being Set When Value is 0 in `Tracer.withSpanContext` - Effect Community
EC
Effect Community
•
7mo ago
marbemac
Issue with `traceFlags` Not Being Set When Value is 0 in `Tracer.withSpanContext`
I
'm trying to use
Tracer.withSpanContext
Tracer.withSpanContext
to propagate a trace originating on another service
. When the upstream service decides not to sample the trace
, traceFlags will be 0
.
But it seems
:
1
. traceFlags is not set on context when the value is 0
(
https://github.com/Effect-TS/effect/blob/6bc3f8090cacefd201dbbc9613f681e0a8b87475/packages/opentelemetry/src/internal/tracer.ts#L191
)
2
. later
, when effect creates new spans
, it calls makeSpanContext
3
. makeSpanContext defaults to OtelApi
.TraceFlags
.SAMPLED when traceFlags is not set on the context
(
https://github.com/Effect-TS/effect/blob/6bc3f8090cacefd201dbbc9613f681e0a8b87475/packages/opentelemetry/src/internal/tracer.ts#L284-L289
)
Is the truthy check in 1 intentional
? vs checking if defined
Effect Community
Join
Production-grade applications in TypeScript.
6,221
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
Issue with parent span not being passed to forked fiber
EC
Effect Community / opentelemetry
3y ago
Effective Method to Obtain Tracer Provider in OpenTelemetry
EC
Effect Community / opentelemetry
2y ago
Custom Tracer for Sentry with Cloudflare and Effect Integration
EC
Effect Community / opentelemetry
7mo ago
Early Release of /opentelemetry Package with Tracer Setup Example
EC
Effect Community / opentelemetry
3y ago