From 0f866a0dedb0f72d3ab7e060c93a05b2bff745b2 Mon Sep 17 00:00:00 2001 From: Natalia Goc Date: Tue, 24 Sep 2024 16:24:19 +0200 Subject: [PATCH] fix: attributes incorrectly added as extra fields in gelf --- pkg/exporters/gelf_exporter/trace.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/exporters/gelf_exporter/trace.go b/pkg/exporters/gelf_exporter/trace.go index 0d10d25..476187c 100644 --- a/pkg/exporters/gelf_exporter/trace.go +++ b/pkg/exporters/gelf_exporter/trace.go @@ -79,8 +79,7 @@ func (e *Exporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) Timestamp: stub.StartTime, // Defaults to ALERT since we consider lack of the level a serious error that should be fixed ASAP. // Otherwise some dangerous unexpected behaviour could go unnoticed. - Level: syslog.ALERT, - ExtraFields: attributes, + Level: syslog.ALERT, } for _, attrKV := range event.Attributes { if attrKV.Key == attr.LogMessageLongKey { @@ -100,6 +99,7 @@ func (e *Exporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) attributes[string(attrKV.Key)] = GetByType(attrKV.Value) } + gelf.ExtraFields = attributes Log(e.gelfWriter, gelf) }