Documentation
¶
Overview ¶
Package tracer to trace function span to apm supported apm is elastic apm, pinpoint apm & opentelemetry
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(opt *option)
Option ...
func WithElastic ¶
func WithElastic() Option
WithElastic setup tracer package with elastic apm tracing.
func WithOpenTelemetry ¶
WithOpenTelemetry setup tracer package with opentelemetry apm tracing.
func WithPinpoint ¶
func WithPinpoint() Option
WithPinpoint setup tracer package with pinpoint apm tracing.
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span describes an operation within a transaction.
func RepositoryFuncSpan ¶
RepositoryFuncSpan returns span for repository layer type.
func ServiceFuncSpan ¶
ServiceFuncSpan returns span for service layer type.
func (*Span) AddEvent ¶
func (s *Span) AddEvent(eventName string, opts ...otelTrace.EventOption)
AddEvent proxy opentelemetry func.
func (*Span) SetAttributes ¶
SetAttributes proxy opentelemetry func.
type SpanLevel ¶
type SpanLevel string
SpanLevel describes span at source code logic level.
var ( // SpanLvlServiceLogic for service function / methods. SpanLvlServiceLogic SpanLevel = "service" // SpanLvlDBQuery for db query call / repository level. SpanLvlDBQuery SpanLevel = "database" // SpanLvlHTTPCall for HTTP api client api call level. SpanLvlHTTPCall SpanLevel = "http.client" // SpanLvlGrpcCall for gRPC api client api call level. SpanLvlGrpcCall SpanLevel = "grpc.client" // SpanLvlHandler for http controller / handler func. SpanLvlHandler SpanLevel = "handler" )
Click to show internal directories.
Click to hide internal directories.