-
Notifications
You must be signed in to change notification settings - Fork 0
/
ITracer.go
32 lines (27 loc) · 1.4 KB
/
ITracer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package trace
import "context"
// ITracer interface for tracer components that capture operation traces.
type ITracer interface {
// Trace records an operation trace with its name and duration
// Parameters:
// - ctx context.Context execution context to trace execution through call chain.
// - component a name of called component
// - operation a name of the executed operation.
// - duration execution duration in milliseconds.
Trace(ctx context.Context, component string, operation string, duration int64)
// Failure records an operation failure with its name, duration and error
// Parameters:
// - ctx context.Context execution context to trace execution through call chain.
// - component a name of called component
// - operation a name of the executed operation.
// - error an error object associated with this trace.
// - duration execution duration in milliseconds.
Failure(ctx context.Context, component string, operation string, err error, duration int64)
//BeginTrace recording an operation trace
// Parameters:
// - ctx context.Context execution context to trace execution through call chain.
// - component a name of called component
// - operation a name of the executed operation.
// Returns: a trace timing object.
BeginTrace(ctx context.Context, component string, operation string) *TraceTiming
}