Skip to content

Commit

Permalink
promslog: use UTC timestamps for go-kit log style (#696)
Browse files Browse the repository at this point in the history
promlog initialized its go-kit logger to use UTC timestamps, so for true
backwards compatibility, the go-kit log style in promslog should retain
that configuration.

Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
  • Loading branch information
dswarbrick authored Sep 20, 2024
1 parent 14bac55 commit d66e745
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion promslog/slog.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var (
// of .999999999 which changes the timestamp from 9 variable to 3 fixed
// decimals (.130 instead of .130987456).
t := a.Value.Time()
a.Value = slog.StringValue(t.Format("2006-01-02T15:04:05.000Z07:00"))
a.Value = slog.StringValue(t.UTC().Format("2006-01-02T15:04:05.000Z07:00"))
case slog.SourceKey:
a.Key = "caller"
src, _ := a.Value.Any().(*slog.Source)
Expand Down

0 comments on commit d66e745

Please sign in to comment.