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

Influx DB: don't unneccessarily truncate timestamps to whole seconds #9599

Merged
merged 2 commits into from
Jan 26, 2023

Conversation

Al2Klimov
Copy link
Member

Instead send timestamps with the highest possible precision (ns). Useful for check intervals <1s.

Before/after

> select * from dummy;
name: dummy
time                hostname metric value
----                -------- ------ -----
1669634632000000000 p/d      lolcat 1
1669634633000000000 p/d      lolcat 1
1669634634000000000 p/d      lolcat 1
1669634635000000000 p/d      lolcat 1
1669634636000000000 p/d      lolcat 1
1669634637000000000 p/d      lolcat 1
1669634638000000000 p/d      lolcat 1
1669634639000000000 p/d      lolcat 1
1669634640000000000 p/d      lolcat 1
1669634641000000000 p/d      lolcat 1
1669634642000000000 p/d      lolcat 1
1669634643000000000 p/d      lolcat 1
1669634644000000000 p/d      lolcat 1
1669634645000000000 p/d      lolcat 1
1669634646000000000 p/d      lolcat 1
1669634647000000000 p/d      lolcat 1
1669634648000000000 p/d      lolcat 1
1669634649000000000 p/d      lolcat 1
1669634650000000000 p/d      lolcat 1
1669634651000000000 p/d      lolcat 1
1669634746813241856 p/d      lolcat 1
1669634747819243008 p/d      lolcat 1
1669634748829480960 p/d      lolcat 1
1669634749837472000 p/d      lolcat 1
1669634750845353984 p/d      lolcat 1
1669634751851262208 p/d      lolcat 1
1669634752858226944 p/d      lolcat 1
1669634753866256896 p/d      lolcat 1
1669634754875664896 p/d      lolcat 1
1669634755882136064 p/d      lolcat 1
1669634756890747136 p/d      lolcat 1
1669634757899697152 p/d      lolcat 1
1669634758907682048 p/d      lolcat 1
1669634759919069952 p/d      lolcat 1
1669634760924881920 p/d      lolcat 1
1669634761930562048 p/d      lolcat 1
1669634762939232000 p/d      lolcat 1
1669634763945729024 p/d      lolcat 1
1669634764953383936 p/d      lolcat 1
1669634765961394944 p/d      lolcat 1
>

Instead send timestamps with the highest possible precision (ns).
Useful for check intervals <1s.
@Al2Klimov Al2Klimov added area/influxdb Metrics to InfluxDB core/quality Improve code, libraries, algorithms, inline docs labels Nov 28, 2022
@Al2Klimov Al2Klimov added this to the 2.14.0 milestone Nov 28, 2022
@cla-bot cla-bot bot added the cla/signed label Nov 28, 2022
@julianbrost
Copy link
Contributor

Does this have any impact on compatibility with InfluxDB, so for example, is there a minimum version required to pass timestamps in nanoseconds?

precision=ns is the default.
@Al2Klimov
Copy link
Member Author

No, it's even the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/influxdb Metrics to InfluxDB cla/signed core/quality Improve code, libraries, algorithms, inline docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants