Documentation
¶
Index ¶
Constants ¶
const ( KOC_KEY = "eppppi.github.io/koc" NUM_ANC_CPIDS = 10 )
const (
CHANNEL_SIZE = 100
)
const (
KOC_PARENTID_KEY contextKey = "eppppi.github.io/koc-parentid"
)
Variables ¶
This section is empty.
Functions ¶
func GetParentId ¶
func InitSender ¶
func InitSender(endpoint string) (<-chan struct{}, func())
InitSender initializes a sender (gRPC client). If wait is true, this func waits until setup is done.
func SetTraceContext ¶
func SetTraceContext(objInterface interface{}, traceCtx *TraceContext) error
SetTraceContext sets trace context
Types ¶
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)
Start starts a span. If returned span is nil, no span is started.
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
GetTraceContext returns trace context (maybe nil)
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 (tc *TraceContext) GetAncCpids() []string
GetAncCpids gets ancestor cpids
func (*TraceContext) SetAncCpids ¶
func (tc *TraceContext) SetAncCpids(ancCpids []string)
SetAncCpids sets ancestor cpids