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

Inserted 'NaN' values are stored as zero in samples_v3 #418

Closed
mat3733 opened this issue Dec 29, 2023 · 9 comments
Closed

Inserted 'NaN' values are stored as zero in samples_v3 #418

mat3733 opened this issue Dec 29, 2023 · 9 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@mat3733
Copy link

mat3733 commented Dec 29, 2023

To reproduce:

in your promwrite.sh test script :
go run main.go -u http://localhost:3100/api/v1/prom/remote/write -t name:foobar -d $dd,NaN

The 'NaN' string is properly parsed into Float64 by the promremotecli go client
but still ended up as a zero value in samples_v3.

@lmangani lmangani added bug Something isn't working enhancement New feature or request labels Dec 29, 2023
@lmangani
Copy link
Collaborator

Thanks for the report @mat3733 we'll look into after this and find a solution

@akvlad
Copy link
Collaborator

akvlad commented Jan 2, 2024

@mat3733
qryn 3.0.28 will filter out all the NaN values. feel free to update.

@mat3733
Copy link
Author

mat3733 commented Jan 2, 2024

Thanks for your quick reactivity but actually, you have done the exact opposite of what we need.
My issue description was not clear, I'm sorry for this.

For our needs, 'NaN' values are very important to be kept in our metrics database.
It means that the device we're collecting metrics from has been down.

In the initial issue, I was complaining that the 'NaN' values were converted to zero values (which can be a real value for a metric).
I think it would be more useful if the 'NaN' values were properly inserted in the Clickhouse database (which supports them for a Float64 value).

@mat3733 mat3733 closed this as completed Jan 2, 2024
@mat3733
Copy link
Author

mat3733 commented Jan 2, 2024

Closed by mistake. Please consider previous message.

@mat3733 mat3733 reopened this Jan 2, 2024
@akvlad
Copy link
Collaborator

akvlad commented Jan 2, 2024

Well, NaN values are questionable about how to work further.
max_over_time(metric_with_NaNs[10m]) how to process this kind of metrics
how to represent NaNs in a chart.

If a device stops producing anything, you can figure it out with absent_over_time function. I need some investigation of how to treat NaN values correctly.

@mat3733
Copy link
Author

mat3733 commented Jan 2, 2024

Indeed, our specific usage of NaN may be doubtful but still : inserting 0 instead of 'NaN' or ignoring inserts with NaN is kind of a bug.

@akvlad
Copy link
Collaborator

akvlad commented Jan 3, 2024

@mat3733
qryn 3.0.29 will write the NaN values as NaN into the samples_v3 table. Feel free to update

@mat3733
Copy link
Author

mat3733 commented Jan 4, 2024

I've tested version 3.0.29 and it works as intended, 'NaN' appears in the Clickhouse DB.
Thanks a lot for your listening and reactivity.

@akvlad
Copy link
Collaborator

akvlad commented Jan 4, 2024

Closing the issue then.
Thanks for the participation.

@akvlad akvlad closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants