Skip to content

Batching POST request is locked on nanosecond timeprecision #128

@Ibbend

Description

@Ibbend

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

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