Skip to content

Commit fac129c

Browse files
committed
set formatters only if the slice of formatters is not empty
Signed-off-by: Tomi Juntunen <[email protected]>
1 parent 5ea3f3b commit fac129c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/xds/translator/accesslog.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,11 @@ func buildXdsAccessLog(al *ir.AccessLog, accessLogType ir.ProxyAccessLogType) ([
358358
}
359359

360360
al.Attributes = convertToKeyValueList(attrs, true)
361-
al.Formatters = accessLogOpenTelemetryFormatters(format, attrs)
361+
formatters := accessLogOpenTelemetryFormatters(format, attrs)
362+
363+
if len(formatters) != 0 {
364+
al.Formatters = formatters
365+
}
362366

363367
accesslogAny, err := proto.ToAnyWithValidation(al)
364368
if err != nil {

0 commit comments

Comments
 (0)