Skip to content

Commit

Permalink
support otel klog
Browse files Browse the repository at this point in the history
  • Loading branch information
smx-Morgan committed Oct 25, 2024
1 parent 274f30c commit bb9e8e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions telemetry/instrumentation/otelslog/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ const (
traceFlagsKey = "trace_flags"
)

type traceConfig struct {
type TraceConfig struct {
recordStackTraceInSpan bool
errorSpanLevel slog.Level
}

type TraceHandler struct {
slog.Handler
tcfg *traceConfig
tcfg *TraceConfig
}

func NewTraceHandler(w io.Writer, opts *slog.HandlerOptions, traceConfig *traceConfig) *TraceHandler {
func NewTraceHandler(w io.Writer, opts *slog.HandlerOptions, traceConfig *TraceConfig) *TraceHandler {
if opts == nil {
opts = &slog.HandlerOptions{}
}
Expand Down
4 changes: 2 additions & 2 deletions telemetry/instrumentation/otelslog/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ func (fn option) apply(cfg *config) {

type config struct {
logger *cwslog.Logger
traceConfig *traceConfig
traceConfig *TraceConfig
options []cwslog.Option
}

// defaultConfig default config
func defaultConfig() *config {
return &config{
traceConfig: &traceConfig{
traceConfig: &TraceConfig{
recordStackTraceInSpan: true,
errorSpanLevel: slog.LevelError,
},
Expand Down

0 comments on commit bb9e8e3

Please sign in to comment.