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

Batching POST request is locked on nanosecond timeprecision #128

Open
Ibbend opened this issue Mar 2, 2023 · 1 comment
Open

Batching POST request is locked on nanosecond timeprecision #128

Ibbend opened this issue Mar 2, 2023 · 1 comment

Comments

@Ibbend
Copy link

Ibbend commented Mar 2, 2023

Steps to reproduce:

Instantiate the session similarly to:

influxdb = InfluxDB2::Client.new("http://#{INFLUXDB_HOST}:8086",
                                          INFLUXDB_TOKEN,
                                          bucket: INFLUXDB_DATA, org: INFLUXDB_ORG,
                                          use_ssl: false,
                                          precision: InfluxDB2::WritePrecision::SECOND)
write_options = InfluxDB2::WriteOptions.new(write_type: InfluxDB2::WriteType::BATCHING,
                                                    batch_size: 100, flush_interval: 90_000,
                                                    max_retries: 3, max_retry_delay: 15_000,
                                                    exponential_base: 2)

influx_write_api = influxdb.create_write_api(write_options: write_options)

influx_write_api.write(data: <whatever data with timestamp in seconds>)

Expected behavior:
The data should be sent with seconds time precision.

Actual behavior:
The data is sent with nanoseconds time precision, and is not recognized by Influx since its timestamp is in seconds.
Here's a screenshot of pcap POST request packet:
image
You can see that the precision used is ns instead of s.

Specifications:

  • Client Version: 2.9.0
  • InfluxDB Version: 2.6.1
  • Platform: Alpine Linux v3.17
@apauly
Copy link

apauly commented Apr 5, 2023

I was having the same issue. Specifying the precision also on the write call worked for me as a workaround:

influx_write_api.write(data: <whatever data with timestamp in seconds>, precision: 's')

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

2 participants