mirror of
https://github.com/hanzoai/traces.git
synced 2026-11-03 04:05:45 +00:00
* Update dskit for gRPC interface change * Update vendor * Update vendor * bump dskit * update go.sum * manifest --------- Co-authored-by: javiermolinar <[email protected]>
31 lines
728 B
Go
31 lines
728 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package jaeger // import "go.opentelemetry.io/contrib/propagators/jaeger"
|
|
|
|
import "context"
|
|
|
|
type jaegerKeyType int
|
|
|
|
const (
|
|
debugKey jaegerKeyType = iota
|
|
)
|
|
|
|
// withDebug returns a copy of parent with debug set as the debug flag value .
|
|
func withDebug(parent context.Context, debug bool) context.Context {
|
|
return context.WithValue(parent, debugKey, debug)
|
|
}
|
|
|
|
// debugFromContext returns the debug value stored in ctx.
|
|
//
|
|
// If no debug value is stored in ctx false is returned.
|
|
func debugFromContext(ctx context.Context) bool {
|
|
if ctx == nil {
|
|
return false
|
|
}
|
|
if debug, ok := ctx.Value(debugKey).(bool); ok {
|
|
return debug
|
|
}
|
|
return false
|
|
}
|