Influx DB precision setting at DB Level

2.7k views Asked by At

Extension of #8746 :

I have tried to set the precision in the config file as seconds. But as i write data and tries to fetch it its again showing Nanoseconds timestamp.

I read the whole Doc but couldn't figure it out only change in my config file is: precision = "s"

help me understand these things

How do I set the precision at DB level and how will I make sure I only get set precision timestamps in epoch. And I am using IST as timezone for my Application so also tell me how to set the same for InfluxDB in configuration

I am using python-influxdb client seriesHelper to write data into db and not specifying any time while writing data.

Edit: Added a pull request to resolve this in influxdb-python SeriesHelper Class - #502

1

There are 1 answers

2
danny On

Set query parameter epoch=s. See docs.

Query parameters are already supported by influxdb-python, for example:

client = InfluxDBClient(<..>)
client.query(<..>, params={'epoch': 's'})