Requirement: I want to create an influxDB database to store time-series data from multiple sensors reporting temperatures from different locations.
Problem: When I write points to the database with same timestamp but different tags (example : location) and field (temperature) value , influx overwrites both tags and fields values with the latest timestamp
I followed the documentation available on their website and they show a sample db with above requirement but am not able find the schema used.
Example Table with duplicate timestamps
Additional Information : Sample Input :
json_body_1 = [
{
"measurement": "cpu_load_short",
"tags": {
"host": "server02",
"region": "us-west"
},
"time": "2009-11-10T23:00:00Z",
"fields": {
"Float_value": 0.7,
"Int_value": 6,
"String_value": "Text",
"Bool_value": False
}
},
{
"measurement": "cpu_load_short",
"tags": {
"host": "server01",
"region": "us-west"
},
"time": "2009-11-10T23:00:00Z",
"fields": {
"Float_value": 1.0,
"Int_value": 2,
"String_value": "Text",
"Bool_value": False
}
}]
I used the example given in official documentation , still instead of 2 records , I get only one. Please note host tag is different which should ideally make each point unique.