Skip to content

Commit

Permalink
fix: skip attr
Browse files Browse the repository at this point in the history
  • Loading branch information
nityanandagohain committed Nov 27, 2024
1 parent 0a2a8bd commit 6fa147c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions exporter/clickhousetracesexporter/clickhouse_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ func newStructuredSpan(otelSpan ptrace.Span, ServiceName string, resource pcommo
spanAttribute.DataType = "float64"
} else {
zap.S().Error("NaN value in tag map: ", zap.String("key", k), zap.Float64("value", v.Double()))
return true
}
} else if v.Type() == pcommon.ValueTypeInt {
if !math.IsNaN(float64(v.Int())) {
Expand All @@ -315,6 +316,7 @@ func newStructuredSpan(otelSpan ptrace.Span, ServiceName string, resource pcommo
spanAttribute.DataType = "float64"
} else {
zap.S().Error("NaN value in tag map: ", zap.String("key", k), zap.Float64("value", v.Double()))
return true
}
} else if v.Type() == pcommon.ValueTypeBool {
boolTagMap[k] = v.Bool()
Expand Down Expand Up @@ -344,6 +346,7 @@ func newStructuredSpan(otelSpan ptrace.Span, ServiceName string, resource pcommo
spanAttribute.DataType = "float64"
} else {
zap.S().Error("NaN value in tag map: ", zap.String("key", k), zap.Float64("value", v.Double()))
return true
}

} else if v.Type() == pcommon.ValueTypeInt {
Expand All @@ -353,6 +356,7 @@ func newStructuredSpan(otelSpan ptrace.Span, ServiceName string, resource pcommo
spanAttribute.DataType = "float64"
} else {
zap.S().Error("NaN value in tag map: ", zap.String("key", k), zap.Float64("value", v.Double()))
return true
}
} else if v.Type() == pcommon.ValueTypeBool {
boolTagMap[k] = v.Bool()
Expand Down

0 comments on commit 6fa147c

Please sign in to comment.