Skip to content

Alert Data Field Value Integer Type Error #2800

@forestmvey

Description

@forestmvey

I am ingesting line protocol into Kapacitor through the HTTP endpoint and seeing floats in the field_set being interpreted as integers. When the floating point number ends in .0 it is interpreted as an integer in the data portion of the generated alert.

Line protocol ingested:

diagnostics,name=truck_100 load_capacity=100.0 1704153700000000000

Alert generated:

{
    "id": "diagnostics:nil",
    "message": "diagnostics:nil is INFO",
    "details": "...",
    "time": "2024-01-02T00:01:40Z",
    "duration": 0,
    "level": "INFO",
    "data": {
        "series": [
            {
                "name": "diagnostics",
                "tags": {
                    "name": "truck_100"
                },
                "columns": [
                    "time",
                    "load_capacity"
                ],
                "values": [
                    [
                        "2024-01-02T00:01:40Z",
                        100
                    ]
                ]
            }
        ]
    },
    "previousLevel": "OK",
    "recoverable": true
}

Here I pass in 100.0 for the load_capacity and the value is reflected as an integer in the data portion of the JSON alert. This only occurs if the floating point ends with a 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions