Documentation
¶
Index ¶
- Constants
- func AddTraceContextToContext(ctx context.Context, tctx *TraceContext) context.Context
- func GetParentIdFromContext(ctx context.Context) string
- func InitSender(endpoint string, timeout time.Duration) (<-chan error, func())
- func SetParentIdToContext(ctx context.Context, parentId string) context.Context
- func SetTraceContext(objInterface interface{}, traceCtx *TraceContext) error
- func SetTraceContextsToContext(ctx context.Context, tctxs []*TraceContext) context.Context
- func SetupTraceServerClient(endpoint string) func()
- func WriteResolvconf()
- type KeyWithTraceContexts
- type Span
- type TraceContext
- func GetTraceContext(objInterface interface{}) *TraceContext
- func GetTraceContextsFromContext(ctx context.Context) []*TraceContext
- func MergeAndSendMergelog(newTctx *TraceContext, sourceTctxs []*TraceContext, causeMsg, by string) (*TraceContext, error)
- func NewRootTraceContextAndSendMergelog(message, by string) *TraceContext
Constants ¶
const ( KOC_KEY = "eppppi.github.io/koc" NUM_ANC_CPIDS = 10 )
const (
CHANNEL_SIZE = 100
)
Variables ¶
This section is empty.
Functions ¶
func AddTraceContextToContext ¶ added in v0.4.7
func AddTraceContextToContext(ctx context.Context, tctx *TraceContext) context.Context
func GetParentIdFromContext ¶ added in v0.4.0
func InitSender ¶
InitSender initializes a sender (gRPC client). If wait is true, this func waits until setup is done.
func SetParentIdToContext ¶ added in v0.4.0
func SetTraceContext ¶
func SetTraceContext(objInterface interface{}, traceCtx *TraceContext) error
REFACTOR: from interface{} to runtime.Object SetTraceContext sets trace context
func SetTraceContextsToContext ¶ added in v0.4.0
func SetTraceContextsToContext(ctx context.Context, tctxs []*TraceContext) context.Context
func SetupTraceServerClient ¶ added in v0.4.6
func SetupTraceServerClient(endpoint string) func()
func WriteResolvconf ¶ added in v0.4.6
func WriteResolvconf()
Types ¶
type KeyWithTraceContexts ¶ added in v0.4.7
type KeyWithTraceContexts struct { Key interface{} TraceCtxs []*TraceContext }
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span is a span that is to be converted to the Span struct of protobuf
func Start ¶
func Start(ctx context.Context, cpid, service, objKind, objName, msg string) (context.Context, *Span, error)
Start starts a span. Eighter cpid or parentSpanId, and not both must be specified <- ?????? not "cpid or parentSpanId", but "cpid or tctx in ctx"?
func (*Span) ToProtoSpan ¶
func (s *Span) ToProtoSpan() *mergelogpb.Span
ToProtoSpan converts a span to the Span struct of protobuf
type TraceContext ¶
func GetTraceContext ¶
func GetTraceContext(objInterface interface{}) *TraceContext
REFACTOR: from interface{} to runtime.Object GetTraceContext returns trace context (maybe nil)
func GetTraceContextsFromContext ¶ added in v0.4.0
func GetTraceContextsFromContext(ctx context.Context) []*TraceContext
func MergeAndSendMergelog ¶ added in v0.2.0
func MergeAndSendMergelog(newTctx *TraceContext, sourceTctxs []*TraceContext, causeMsg, by string) (*TraceContext, error)
GenerateNewTctxAndSendMergelog generates a new trace context. if retTctx is nil, no mergelog is sent.
func NewRootTraceContextAndSendMergelog ¶ added in v0.2.0
func NewRootTraceContextAndSendMergelog(message, by string) *TraceContext
NewRootTraceContext creates a new root trace context and send mergelog of it
func (*TraceContext) DeepCopyTraceContext ¶ added in v0.2.0
func (tctx *TraceContext) DeepCopyTraceContext() *TraceContext
DeepCopyTraceContext deep copies a trace context
func (*TraceContext) GetAncCpids ¶
func (tctx *TraceContext) GetAncCpids() []string
GetAncCpids gets ancestor cpids
func (*TraceContext) SetAncCpids ¶
func (tctx *TraceContext) SetAncCpids(ancCpids []string)
SetAncCpids sets ancestor cpids