Skip to content

Commit

Permalink
fix(ddtrace/tracer): avoid tests to fail with error "non-constant for…
Browse files Browse the repository at this point in the history
…mat string" from upcoming go 1.24 release
  • Loading branch information
darccio committed Dec 2, 2024
1 parent 697219e commit ea93428
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ddtrace/tracer/abandonedspans.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func (d *abandonedSpansDebugger) log(interval *time.Duration) {
log.Warn("Too many abandoned spans. Truncating message.")
sb.WriteString("...")
}
log.Warn(sb.String())
log.Warn("%s", sb.String())
}

// formatAbandonedSpans takes a bucket and returns a human-readable string representing
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/tracer/option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func TestIntegrationEnabled(t *testing.T) {
var out contribPkg
err := stream.Decode(&out)
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
packages = append(packages, out)
}
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/tracer/otel_dd_mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func getDDorOtelConfig(configName string) string {
} else {
v, err := config.remapper(otVal)
if err != nil {
log.Warn(err.Error())
log.Warn("%s", err.Error())
telemetryTags := []string{ddPrefix + strings.ToLower(config.dd), otelPrefix + strings.ToLower(config.ot)}
telemetry.GlobalClient.Count(telemetry.NamespaceTracers, "otel.env.invalid", 1.0, telemetryTags, true)
}
Expand Down
8 changes: 4 additions & 4 deletions ddtrace/tracer/slog.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ func (h slogHandler) Handle(ctx context.Context, r slog.Record) error {
msg := strings.Join(parts, " ")
switch r.Level {
case slog.LevelDebug:
log.Debug(msg)
log.Debug("%s", msg)
case slog.LevelInfo:
log.Info(msg)
log.Info("%s", msg)
case slog.LevelWarn:
log.Warn(msg)
log.Warn("%s", msg)
case slog.LevelError:
log.Error(msg)
log.Error("%s", msg)
}
return nil
}
Expand Down

0 comments on commit ea93428

Please sign in to comment.