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]>
  • Loading branch information
shubbham1215 committed Nov 8, 2022
1 parent 7567490 commit ae3f76b
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 ae3f76b

Please sign in to comment.