Lack of time field caused loss of Alarm History
The time field was name timestamp which caused influxdb to use the write time for the time field. If multiple Alarm History messages were written, Influxdb only kept the last because the times were not unique. Change-Id: I3808838bb8a26d7a6272ab41c3e586659a037f02
This commit is contained in:
parent
3964f2aae2
commit
b20d019a20
@ -308,7 +308,7 @@ class AlarmPersister(AbstractPersister):
|
||||
ts = time_stamp / 1000.0
|
||||
|
||||
data = {"measurement": 'alarm_state_history',
|
||||
"timestamp": datetime.fromtimestamp(ts, tz=pytz.utc).strftime(
|
||||
"time": datetime.fromtimestamp(ts, tz=pytz.utc).strftime(
|
||||
'%Y-%m-%dT%H:%M:%S.%fZ'),
|
||||
"fields": {
|
||||
"tenant_id": tenant_id.encode('utf8'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user