From 3fa5931ac088b51c44800a94f5af37cb7ac9cf8d Mon Sep 17 00:00:00 2001 From: Oscar Reyes Date: Wed, 11 Sep 2024 12:07:00 -0600 Subject: [PATCH] adding resource attributes to spans --- server/traces/otel_converter.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/traces/otel_converter.go b/server/traces/otel_converter.go index b10d60f4ca..115838c3af 100644 --- a/server/traces/otel_converter.go +++ b/server/traces/otel_converter.go @@ -30,6 +30,11 @@ func FromOtelResourceSpans(resourceSpans []*v1.ResourceSpans) Trace { // Add attributes from the resource span.Attributes = append(span.Attributes, scopeSpans.Scope.Attributes...) } + + // Add attributes from the resource + if resource.Resource != nil { + span.Attributes = append(span.Attributes, resource.Resource.Attributes...) + } } flattenSpans = append(flattenSpans, scopeSpans.Spans...)