Merge branch 'main' into hotfix

This commit is contained in:
2024-11-24 08:40:24 +01:00
3 changed files with 26 additions and 1 deletions

View File

@@ -313,7 +313,20 @@ func decodeLine(dec *lineprotocol.Decoder,
}
if t, err = dec.Time(lineprotocol.Second, t); err != nil {
return fmt.Errorf("host %s: timestamp : %#v with error : %#v", host, lineprotocol.Second, err.Error())
t = time.Now()
if t, err = dec.Time(lineprotocol.Millisecond, t); err != nil {
t = time.Now()
if t, err = dec.Time(lineprotocol.Microsecond, t); err != nil {
t = time.Now()
if t, err = dec.Time(lineprotocol.Nanosecond, t); err != nil {
return fmt.Errorf("host %s: timestamp : %#v with error : %#v", host, t, err.Error())
}
}
}
}
if err != nil {
return fmt.Errorf("host %s: timestamp : %#v with error : %#v", host, t, err.Error())
}
if err := ms.WriteToLevel(lvl, selector, t.Unix(), []memorystore.Metric{metric}); err != nil {