mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix the event attributes (#54117)
This commit is contained in:
parent
9be8b0564a
commit
4d4ecd7fec
@ -270,10 +270,10 @@ func (s OpentelemetrySpan) RecordError(err error, options ...trace.EventOption)
|
|||||||
|
|
||||||
func (s OpentelemetrySpan) AddEvents(keys []string, values []EventValue) {
|
func (s OpentelemetrySpan) AddEvents(keys []string, values []EventValue) {
|
||||||
for i, v := range values {
|
for i, v := range values {
|
||||||
if v.Num != 0 {
|
if v.Str != "" {
|
||||||
s.span.AddEvent(keys[i], trace.WithAttributes(attribute.Key(keys[i]).String(v.Str)))
|
s.span.AddEvent(keys[i], trace.WithAttributes(attribute.Key(keys[i]).String(v.Str)))
|
||||||
}
|
}
|
||||||
if v.Str != "" {
|
if v.Num != 0 {
|
||||||
s.span.AddEvent(keys[i], trace.WithAttributes(attribute.Key(keys[i]).Int64(v.Num)))
|
s.span.AddEvent(keys[i], trace.WithAttributes(attribute.Key(keys[i]).Int64(v.Num)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user