Documentation
¶
Index ¶
- Constants
- type DatabaseTraceFinishFunc
- type DatabaseTraceFinishOption
- type DatabaseTraceFinishOptions
- type DatabaseTraceOption
- type DatabaseTraceOptions
- type ExternalTraceFinishFunc
- type ExternalTraceFinishOption
- type ExternalTraceFinishOptions
- type ExternalTraceOption
- type ExternalTraceOptions
- type GrpcTraceFinishFunc
- type GrpcTraceFinishOption
- type GrpcTraceFinishOptions
- type GrpcTraceOption
- type GrpcTraceOptions
- type HttpClientTraceFinishFunc
- type HttpClientTraceFinishOption
- type HttpClientTraceFinishOptions
- type HttpClientTraceOption
- type HttpClientTraceOptions
- type InternalTraceFinishFunc
- type InternalTraceFinishOption
- type InternalTraceFinishOptions
- type InternalTraceOption
- type InternalTraceOptions
- type SpanFinishFunc
- type SpanInfo
- type Tracer
Constants ¶
View Source
const ( PIPELINE = "pipeline" DATABASE = "database" HTTP_CLIENT = "http_client" GRPC_CLIENT = "grpc_client" HTTP_SERVER = "http_server" GRPC_SERVER = "grpc_server" INTERNAL = "internal" EXTERNAL = "external" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseTraceFinishFunc ¶
type DatabaseTraceFinishFunc func(context.Context, ...DatabaseTraceFinishOption)
type DatabaseTraceFinishOption ¶
type DatabaseTraceFinishOption func(*DatabaseTraceFinishOptions)
func WithDBError ¶
func WithDBError(err error) DatabaseTraceFinishOption
type DatabaseTraceFinishOptions ¶
type DatabaseTraceFinishOptions struct {
Error error
}
type DatabaseTraceOption ¶
type DatabaseTraceOption func(*DatabaseTraceOptions)
Database trace options
func WithDBName ¶
func WithDBName(dbName string) DatabaseTraceOption
func WithDBSql ¶
func WithDBSql(sql string) DatabaseTraceOption
func WithDBTableName ¶
func WithDBTableName(tableName string) DatabaseTraceOption
type DatabaseTraceOptions ¶
type ExternalTraceFinishFunc ¶
type ExternalTraceFinishFunc func(context.Context, ...ExternalTraceFinishOption)
type ExternalTraceFinishOption ¶
type ExternalTraceFinishOption func(*ExternalTraceFinishOptions)
func WithExternalResponse ¶
func WithExternalResponse(res interface{}) ExternalTraceFinishOption
type ExternalTraceFinishOptions ¶
type ExternalTraceFinishOptions struct {
Response interface{}
}
type ExternalTraceOption ¶
type ExternalTraceOption func(*ExternalTraceOptions)
External trace options
func WithExternalEndpoint ¶
func WithExternalEndpoint(endpoint string) ExternalTraceOption
func WithExternalServiceName ¶
func WithExternalServiceName(serviceName string) ExternalTraceOption
type ExternalTraceOptions ¶
type GrpcTraceFinishFunc ¶
type GrpcTraceFinishFunc func(context.Context, ...GrpcTraceFinishOption)
type GrpcTraceFinishOption ¶
type GrpcTraceFinishOption func(*GrpcTraceFinishOptions)
func WithGrpcError ¶
func WithGrpcError(err error) GrpcTraceFinishOption
type GrpcTraceFinishOptions ¶
type GrpcTraceFinishOptions struct {
Error error
}
type GrpcTraceOptions ¶
type GrpcTraceOptions struct{}
type HttpClientTraceFinishFunc ¶
type HttpClientTraceFinishFunc func(context.Context, ...HttpClientTraceFinishOption)
type HttpClientTraceFinishOption ¶
type HttpClientTraceFinishOption func(*HttpClientTraceFinishOptions)
func WithHttpResponse ¶
func WithHttpResponse(response *http.Response) HttpClientTraceFinishOption
type HttpClientTraceOption ¶
type HttpClientTraceOption func(*HttpClientTraceOptions)
HTTP trace options
func WithHttpRequest ¶
func WithHttpRequest(request *http.Request) HttpClientTraceOption
type HttpClientTraceOptions ¶
type InternalTraceFinishFunc ¶
type InternalTraceFinishFunc func(context.Context, ...InternalTraceFinishOption)
type InternalTraceFinishOption ¶
type InternalTraceFinishOption func(*InternalTraceFinishOptions)
func WithErrorResponse ¶
func WithErrorResponse(err error) InternalTraceFinishOption
func WithInternalResponse ¶
func WithInternalResponse(response interface{}) InternalTraceFinishOption
type InternalTraceFinishOptions ¶
type InternalTraceFinishOptions struct { Response interface{} Error error }
type InternalTraceOption ¶
type InternalTraceOption func(*InternalTraceOptions)
Internal trace options
func WithInternalRequest ¶
func WithInternalRequest(request interface{}) InternalTraceOption
type InternalTraceOptions ¶
type InternalTraceOptions struct {
Request interface{}
}
type SpanFinishFunc ¶
type Tracer ¶
type Tracer interface { // Extract span info from the context ExtractSpanInfo(context.Context) *SpanInfo // Used for tracing HTTP Client Call StartHttpClientTrace(ctx context.Context, spanName string, opts ...HttpClientTraceOption) (context.Context, HttpClientTraceFinishFunc) // Used for tracing GRPC Client Call StartGrpcClientTrace(ctx context.Context, spanName string, opts ...GrpcTraceOption) (context.Context, GrpcTraceFinishFunc) // Used for tracing DATABASE call StartDatabaseTrace(ctx context.Context, spanName string, opts ...DatabaseTraceOption) (context.Context, DatabaseTraceFinishFunc) // Used for tracing other external services (queue, cache,...) StartExternalTrace(ctx context.Context, spanName string, opts ...ExternalTraceOption) (context.Context, ExternalTraceFinishFunc) // Used for tracing interal functions StartInternalTrace(ctx context.Context, spanName string, opts ...InternalTraceOption) (context.Context, InternalTraceFinishFunc) }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.