fix: attributes incorrectly added as extra fields in gelf
This commit is contained in:
		@@ -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)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user