Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartSpanFromContext ¶
func StartSpanFromContext(ctx context.Context, operationName string) (opentracing.Span, context.Context)
StartSpanFromContext starts a span only if there's a parent span in the context. Otherwise, it returns a noop span. To be used in places where we might not have access to the original context.
Types ¶
type ContextRegistry ¶
type ContextRegistry struct {
// contains filtered or unexported fields
}
ContextRegistry maintains a mapping of IDs to contexts for tracing purposes. This allows us to propagate tracing context from HTTP handlers down to BoltDB transactions without persisting the context in Raft logs.
The registry is only used on the leader node where Propose() is called. Followers will not have contexts available and will use context.Background() instead.
func NewContextRegistry ¶
func NewContextRegistry(reg prometheus.Registerer) *ContextRegistry
NewContextRegistry creates a new context registry with background cleanup.
func (*ContextRegistry) Delete ¶
func (r *ContextRegistry) Delete(id string)
Delete removes the context for the given ID.
func (*ContextRegistry) Retrieve ¶
func (r *ContextRegistry) Retrieve(id string) (context.Context, bool)
Retrieve gets the context for the given ID.
func (*ContextRegistry) Shutdown ¶
func (r *ContextRegistry) Shutdown()
Shutdown stops the cleanup loop.
func (*ContextRegistry) Size ¶
func (r *ContextRegistry) Size() int
Size returns the current number of entries in the registry. This is primarily useful for metrics and testing.