fix: attributes incorrectly added as extra fields in gelf
This commit is contained in:
parent
4654238920
commit
0f866a0ded
@ -79,8 +79,7 @@ func (e *Exporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan)
|
|||||||
Timestamp: stub.StartTime,
|
Timestamp: stub.StartTime,
|
||||||
// Defaults to ALERT since we consider lack of the level a serious error that should be fixed ASAP.
|
// 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.
|
// Otherwise some dangerous unexpected behaviour could go unnoticed.
|
||||||
Level: syslog.ALERT,
|
Level: syslog.ALERT,
|
||||||
ExtraFields: attributes,
|
|
||||||
}
|
}
|
||||||
for _, attrKV := range event.Attributes {
|
for _, attrKV := range event.Attributes {
|
||||||
if attrKV.Key == attr.LogMessageLongKey {
|
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)
|
attributes[string(attrKV.Key)] = GetByType(attrKV.Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gelf.ExtraFields = attributes
|
||||||
Log(e.gelfWriter, gelf)
|
Log(e.gelfWriter, gelf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user