Documentation
¶
Index ¶
- Constants
- Variables
- func EnabledTracing()
- func LogOutbound(rt http.RoundTripper) http.RoundTripper
- func SubscribeMonitor(logger *zap.Logger, item MonitorService)
- func ToByte(obj any) []byte
- type AppSettings
- type ConsoleTracing
- type GinTracingService
- type MonitorService
- type RespLogging
- type TracingDetails
- type TracingRequestService
Constants ¶
View Source
const (
KeyTracingID = "tracingID"
)
Variables ¶
View Source
var InitTracingService = func(logger *zap.Logger) *TracingRequestService { sr := &TracingRequestService{ Log: logger, } settings := viper.Sub("tracing") if settings == nil { logger.Warn("tracing module loaded, but disabled.") return sr } settings.Unmarshal(sr) logger.Info("tracing service is enabled.") if (sr.Request || sr.Resp) && sr.Console { c := InitConsoleTracingService(sr.Log) TracingAdaptor.Subscripter("console", c.LogBody) } return sr }
View Source
var TracingAdaptor = core.NewChanAdaptor[*TracingDetails](math.MaxInt16)
Functions ¶
func EnabledTracing ¶ added in v0.0.4
func EnabledTracing()
func LogOutbound ¶ added in v0.1.10
func LogOutbound(rt http.RoundTripper) http.RoundTripper
func SubscribeMonitor ¶ added in v0.0.2
func SubscribeMonitor(logger *zap.Logger, item MonitorService)
Types ¶
type AppSettings ¶
type ConsoleTracing ¶ added in v0.0.4
func InitConsoleTracingService ¶ added in v0.0.4
func InitConsoleTracingService(log *zap.Logger) *ConsoleTracing
func (*ConsoleTracing) LogBody ¶ added in v0.0.4
func (tr *ConsoleTracing) LogBody(req *TracingDetails) error
type GinTracingService ¶ added in v0.1.15
type GinTracingService struct {
Service *TracingRequestService
}
func (*GinTracingService) LogfullRequestDetails ¶ added in v0.1.15
func (tr *GinTracingService) LogfullRequestDetails(c *gin.Context)
func (*GinTracingService) OnEngineInited ¶ added in v0.1.15
func (tr *GinTracingService) OnEngineInited(r *gin.Engine) error
func (*GinTracingService) Priority ¶ added in v0.1.15
func (tr *GinTracingService) Priority() int
type MonitorService ¶
type MonitorService interface { ReportTracing(tr *TracingDetails) error ReportError(core.ErrorReport) error ReportScheduleJob(req *schedule.JobHistory) error }
type RespLogging ¶ added in v0.0.4
type RespLogging struct { gin.ResponseWriter // contains filtered or unexported fields }
type TracingDetails ¶ added in v0.0.4
type TracingRequestService ¶ added in v0.0.4
type TracingRequestService struct { Log *zap.Logger Console bool Request bool Resp bool Included []string Excluded []string }
func (*TracingRequestService) ShouldLogReq ¶ added in v0.1.14
func (tr *TracingRequestService) ShouldLogReq(ctx context.Context, uri string) bool
Click to show internal directories.
Click to hide internal directories.