Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert Data Field Value Integer Type Error #2800

Open
forestmvey opened this issue Mar 12, 2024 · 1 comment
Open

Alert Data Field Value Integer Type Error #2800

forestmvey opened this issue Mar 12, 2024 · 1 comment

Comments

@forestmvey
Copy link

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.

@forestmvey
Copy link
Author

Is there a way to have these floats interpreted correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant