Documentation ¶
Index ¶
- func IsSpanTagged(s *monkit.Span, tag *TagRef) bool
- func IsTraceTagged(t *monkit.Trace, tag *TagRef) bool
- func JustTaggedSpans(spans []*collect.FinishedSpan, tag *TagRef) (rv []*collect.FinishedSpan)
- func SaveTrace(spans []*collect.FinishedSpan, capped bool, pathPrefix string) error
- func SaveTracesWithTag(tag *TagRef, justTaggedSpans bool, traceMax int, path string) (cancel func())
- func Tag(ctx context.Context, tag *TagRef) bool
- func TagScope(tag *TagRef, s *monkit.Scope)
- func TracePathPrefix(spans []*collect.FinishedSpan, capped bool) string
- func TracesWithTag(tag *TagRef, traceMax int, ...) (cancel func())
- type TagRef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSpanTagged ¶
IsSpanTagged returns true if this specific Span got tagged.
func IsTraceTagged ¶
IsTraceTagged returns true if any span in the trace got tagged.
func JustTaggedSpans ¶
func JustTaggedSpans(spans []*collect.FinishedSpan, tag *TagRef) (rv []*collect.FinishedSpan)
JustTaggedSpans filters a list of spans to just the ones that are explicitly tagged. It also keeps the first span either way, as that is probably the best name for the trace.
func SaveTrace ¶
func SaveTrace(spans []*collect.FinishedSpan, capped bool, pathPrefix string) error
SaveTrace saves a trace to pathPrefix with ".json" or ".svg" added.
func SaveTracesWithTag ¶
func SaveTracesWithTag(tag *TagRef, justTaggedSpans bool, traceMax int, path string) (cancel func())
SaveTracesWithTag saves all traces with the tag into the provided path as a folder
func Tag ¶
Tag attempts to mark the current trace with the provided tag and if successful, returns true. It will not tag the current trace if the tag is not enabled. Tags are disabled by default.
func TracePathPrefix ¶
func TracePathPrefix(spans []*collect.FinishedSpan, capped bool) string
TracePathPrefix returns a relative path for the trace with everything but the extension
func TracesWithTag ¶
func TracesWithTag(tag *TagRef, traceMax int, observe func(spans []*collect.FinishedSpan, capped bool)) (cancel func())
TracesWithTag calls the provided observe callback with all spans that belong to traces that are no longer running (no current spans with that trace exist), where at least one span was tagged with the provided tag. It returns a cancel method that will stop new trace collection as well as any currently collecting traces.
Types ¶
type TagRef ¶
type TagRef struct {
// contains filtered or unexported fields
}
TagRef represents a distinct tag reference