fix: prometheusremotewrite wrong timestamp unit (#10547)

This commit is contained in:
hulucc 2022-02-17 00:00:37 +08:00 committed by GitHub
parent d45281cba6
commit 4c42880796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -195,7 +195,7 @@ func (s *Serializer) SerializeBatch(metrics []telegraf.Metric) ([]byte, error) {
// sample then we can skip over it.
m, ok := entries[metrickey]
if ok {
if metric.Time().Before(time.Unix(m.Samples[0].Timestamp, 0)) {
if metric.Time().Before(time.Unix(0, m.Samples[0].Timestamp*1_000_000)) {
continue
}
}