Skip to content

Commit bb9e8e3

Browse files
committed
support otel klog
1 parent 274f30c commit bb9e8e3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

telemetry/instrumentation/otelslog/handler.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ const (
3030
traceFlagsKey = "trace_flags"
3131
)
3232

33-
type traceConfig struct {
33+
type TraceConfig struct {
3434
recordStackTraceInSpan bool
3535
errorSpanLevel slog.Level
3636
}
3737

3838
type TraceHandler struct {
3939
slog.Handler
40-
tcfg *traceConfig
40+
tcfg *TraceConfig
4141
}
4242

43-
func NewTraceHandler(w io.Writer, opts *slog.HandlerOptions, traceConfig *traceConfig) *TraceHandler {
43+
func NewTraceHandler(w io.Writer, opts *slog.HandlerOptions, traceConfig *TraceConfig) *TraceHandler {
4444
if opts == nil {
4545
opts = &slog.HandlerOptions{}
4646
}

telemetry/instrumentation/otelslog/option.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ func (fn option) apply(cfg *config) {
3333

3434
type config struct {
3535
logger *cwslog.Logger
36-
traceConfig *traceConfig
36+
traceConfig *TraceConfig
3737
options []cwslog.Option
3838
}
3939

4040
// defaultConfig default config
4141
func defaultConfig() *config {
4242
return &config{
43-
traceConfig: &traceConfig{
43+
traceConfig: &TraceConfig{
4444
recordStackTraceInSpan: true,
4545
errorSpanLevel: slog.LevelError,
4646
},

0 commit comments

Comments
 (0)