You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default both the standard json library and golang jsoniter library converts number value to float64, there is an option UseNumber from the library, with it enabled, the value will be json.Number and then v.Int64() or v.Float64() returns value in corresponding type or any parse error. It would make sense to honor the original data type from the json parser perspective.
Steps to Reproduce
use json parser to parse a sample json file. f.e. given following log line
Component(s)
pkg/stanza
What happened?
Description
By default both the standard json library and golang jsoniter library converts number value to float64, there is an option
UseNumber
from the library, with it enabled, the value will bejson.Number
and then v.Int64() or v.Float64() returns value in corresponding type or any parse error. It would make sense to honor the original data type from the json parser perspective.Steps to Reproduce
use json parser to parse a sample json file. f.e. given following log line
Expected Result
int: int64(1), float: float64(1.0)
Actual Result
int: float64(1), float: float64(1.0)
Collector version
latest
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: