influxdb-python icon indicating copy to clipboard operation
influxdb-python copied to clipboard

specifying retention policy doesn't write points to measurement

Open adihat opened this issue 8 years ago • 3 comments

So basically I have a database say websockets and the following is the configuration of the database: screenshot 2018-10-23 at 1 19 57 pm

As one can observe there is a retention policy a_day created on database websockets

When I specify the retention policy in write_points, it doesn't write to the measurement requests_stats as shown:

client = InfluxDBClient(host='localhost', port=8086) 
json_body = [
             {
		'measurement': 'requests_stats',
		'tags': {
			'host': 'hostA',
			'function': 'connect',
		},
		'fields': {
			'time_to_execute': 95.27
		}
	    }
       ]
client.write_points(json_body, time_precision='ms', database='websockets', retention_policy='a_day')

The above works if I don't specify the retention policy param in write_points.

Now I tested the same with HTTP API and found the similar behaviour.

Enclosing postman screenshots for your reference: This works: screenshot 2018-10-23 at 1 27 04 pm

This doesn't: screenshot 2018-10-23 at 1 26 55 pm

So I think there is some issue with the HTTP API.

Any thoughts?

adihat avatar Oct 23 '18 07:10 adihat

Having the same problem right now. Have anyone dealt with it? pip influxdb version 5.2.3 (latest by now) InfluxDB version: 1.6.3

Tonsofattraction avatar Nov 27 '19 16:11 Tonsofattraction

Same with me, and I noticed what's happening. It actually writes points even if you specify retention policy. Try these commands on your console to find the data:

use websockets.a_day
select * from requests_stats

meetaco avatar Apr 27 '20 16:04 meetaco

Same with me, and I noticed what's happening. It actually writes points even if you specify retention policy. Try these commands on your console to find the data:

use websockets.a_day
select * from requests_stats

Thanks! It works.

jackyyeh5111 avatar Jun 17 '21 00:06 jackyyeh5111