Open
Description
Problem Statement
SentryHandler call CaptureEvent directly, but if want to AttachStacktrace, need to call CaptureMessage instead
Solution Brainstorm
func (h *SentryHandler) Handle(ctx context.Context, record slog.Record) error {
hub := sentry.CurrentHub()
if hubFromContext := sentry.GetHubFromContext(ctx); hubFromContext != nil {
hub = hubFromContext
} else if h.option.Hub != nil {
hub = h.option.Hub
}
fromContext := contextExtractor(ctx, h.option.AttrFromContext)
event := h.option.Converter(h.option.AddSource, h.option.ReplaceAttr, append(h.attrs, fromContext...), h.groups, &record, hub)
hub.CaptureMessage(event)
return nil
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status