Skip to content

Commit

Permalink
Signed-off-by: Shubham Sawaiker <[email protected]>
Browse files Browse the repository at this point in the history
 [Bug]: span tags of type int64 may lose precision jaegertracing#3958

Signed-off-by: Shubham Sawaiker <[email protected]>
Signed-off-by: shubbham1215 <[email protected]>
  • Loading branch information
shubbham1215 committed Mar 5, 2023
1 parent aa8ec83 commit a13035f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions model/converter/json/from_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
)

const (
js_limit_max = 9007199254740991
js_limit_min = -9007199254740991
jsMaxSafeInteger = int64(1)<<53 - 1
jsMinSafeInteger = -jsMaxSafeInteger
)

// FromDomain converts model.Trace into json.Trace format.
Expand Down Expand Up @@ -128,7 +128,7 @@ func (fd fromDomain) convertKeyValues(keyValues model.KeyValues) []json.KeyValue
value = kv.Bool()
case model.Int64Type:
value = kv.Int64()
if kv.Int64() > js_limit_max || kv.Int64() < js_limit_min {
if kv.Int64() > jsMaxSafeInteger || kv.Int64() < jsMinSafeInteger {
kv.VType = 0
value = fmt.Sprintf("%d", value)
}
Expand Down

0 comments on commit a13035f

Please sign in to comment.