From 4654238920907116b0dd1ab041e06bc11a4aeacc Mon Sep 17 00:00:00 2001 From: Natalia Goc Date: Tue, 24 Sep 2024 16:05:58 +0200 Subject: [PATCH] feat: add attributes from resource to gelf exports --- pkg/exporters/gelf_exporter/trace.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/exporters/gelf_exporter/trace.go b/pkg/exporters/gelf_exporter/trace.go index 1abcde1..0d10d25 100644 --- a/pkg/exporters/gelf_exporter/trace.go +++ b/pkg/exporters/gelf_exporter/trace.go @@ -61,10 +61,15 @@ func (e *Exporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) stub := &stubs[i] var attributes = make(map[string]interface{}) + for _, attr := range stub.Attributes { attributes[string(attr.Key)] = GetByType(attr.Value) } + for _, attr := range stub.Resource.Attributes() { + attributes[string(attr.Key)] = GetByType(attr.Value) + } + for i := range stub.Events { event := stub.Events[i]