Skip to content

JSON input losing precision on 64bit integers #7555

@nathanpegram

Description

@nathanpegram

Relevant telegraf.conf:

   data_format = "json"
   tag_keys = ["DEVICEID"]
   json_time_key = "measuredDtm"
   json_time_format = "2006-01-02T15:04:05+00:00"

System info:

telegraf 1.14 on ubuntu18.04

Steps to reproduce:

I am using telegraf to consume json input format. I have a tag key set to transform DEVICEID into an influxdb tag. The problem is that the tag ends up with truncated precision before is becomes a string.

Expected behavior:

source json which contains: ...,"DEVICEID":2882429806056571124,... should yield a metric with tag of DEVICEID=2882429806056571124.

Actual behavior:

source json which contains: ...,"DEVICEID":2882429806056571124,... actually yields a tag of DEVICEID=2882429806056571000. Note the zeroes in the least significant digits.

Metadata

Metadata

Assignees

Labels

area/jsonjson and json_v2 parser/serialiser relatedbugunexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions