MCPcopy Create free account

hub / github.com/bketelsen/trace / functions

Functions40 in github.com/bketelsen/trace

↓ 8 callersMethodFinish
Finish declares that this trace is complete. The trace should not be used after calling this method.
trace.go:104
↓ 5 callersFunctionNewContext
NewContext returns a new context.Context and Trace with the given family and title. The trace will be stored in the context.
context.go:48
↓ 5 callersMethodPrintf
Printf formats its arguments with fmt.Sprintf and adds the result to the event log.
events.go:24
↓ 5 callersMethodSetError
SetError declares that this trace resulted in an error.
trace.go:76
↓ 4 callersMethodString
()
log.go:83
↓ 3 callersFunctionDumpMetrics
DumpMetrics returns the metrics prometheus would return when collected as a string, for fun and testing
metrics.go:103
↓ 3 callersFunctionKeyValue
KeyValue creates a Key/Value pair that is suitable for use in the LogMessage() function
log.go:34
↓ 2 callersMethodLazyLog
LazyLog adds x to the event log. It will be evaluated each time the debug/requests page is rendered. Any memory referenced by x will be pinned until t
trace.go:61
↓ 2 callersMethodLazyPrintf
LazyPrintf evaluates its arguments with fmt.Sprintf each time the debug/requests page is rendered. Any memory referenced by a will be pinned until the
trace.go:69
↓ 2 callersFunctionLogMessage
LogMessage creates a message that complies with fmt.Stringer but also includes a message and key/value pairs for structured logging. Use it in trace.L
log.go:43
↓ 2 callersFunctionincrError
(t *trace)
metrics.go:63
↓ 2 callersFunctionnewTrace
(family, title string)
trace.go:34
↓ 2 callersFunctionrandomID
()
trace.go:115
↓ 2 callersFunctiontoString
(x interface{})
log.go:111
↓ 1 callersMethodFinish
Finish declares that this event log is complete. The event log should not be used after calling this method.
events.go:38
↓ 1 callersFunctionaddEvent
(t *EventLog, format string, a ...interface{})
log.go:76
↓ 1 callersFunctionaddTrace
(t *trace, format string, a ...interface{})
log.go:68
↓ 1 callersMethodchild
(title string)
trace.go:46
↓ 1 callersFunctioncontextWithTrace
(ctx context.Context, trace *trace)
context.go:14
↓ 1 callersFunctionduration
(t *trace)
metrics.go:68
↓ 1 callersFunctionincr
(t *trace)
metrics.go:58
↓ 1 callersFunctionlogMessageWithTrace
(t *trace, message string, keyvals ...keyval)
log.go:47
↓ 1 callersFunctionparentOrChildFromContext
(ctx context.Context, family, title string)
context.go:28
↓ 1 callersFunctionsearch
(ctx context.Context, root string, pattern string)
examples/gogrep/gogrep.go:16
↓ 1 callersFunctiontraceFromContext
(ctx context.Context)
context.go:20
MethodErrorf
Errorf is like Printf, but it marks this event as an error.
events.go:31
FunctionNew
New returns a new Trace with the specified family and title.
trace.go:30
FunctionNewEventLog
NewEventLog returns an initialized EventLog with the given family and title.
events.go:13
FunctionPushMetrics
PushMetrics sends the metrics collected to the prometheus push gateway at the url in `gatewayURL` with the job name of `task` Should be called in a de
metrics.go:85
MethodServeHTTP
Inside the handler, use traces to capture request specific events and timings and the el member to log service specific events - like failures
examples/service/main.go:20
FunctionServeMetrics
ServeMetrics serves Prometheus metrics endpoint on the provided net.Listener Use for long-running services. For cli tools, use PushMetrics instead.
metrics.go:77
FunctionSetAuthRequest
SetAuthRequest sets the AuthRequest function for the underlying trace HTTP listener, which determines whether a specific request is permitted to load
trace.go:25
FunctionSetLogger
SetLogger replaces the default logger with a new one that writes to 'out', has 'prefix', and flags 'flag'
log.go:18
MethodSetMaxEvents
SetMaxEvents sets the maximum number of events that will be stored in the trace. This has no effect if any events have already been added to the trace
trace.go:98
MethodSetRecycler
SetRecycler sets a recycler for the trace. f will be called for each event passed to LazyLog at a time when it is no longer required, whether while th
trace.go:85
MethodSetTraceInfo
SetTraceInfo sets the trace info for the trace. This is currently unused.
trace.go:91
FunctionTitleFromContext
TitleFromContext is a convenience function that returns the Trace's title from a context or an empty string if none exists
context.go:38
Functioninit
()
metrics.go:19
Functionmain
()
examples/service/main.go:30
Functionmain
()
examples/gogrep/main.go:14