Merge pull request #16914 from dashpole/simplify_target

Simplify target_info addition in the otlptranslator
This commit is contained in:
David Ashpole 2025-07-30 13:21:01 -04:00 committed by GitHub
commit ff3882fd35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -684,12 +684,10 @@ func addResourceTargetInfo(resource pcommon.Resource, settings Settings, earlies
Timestamp: timestamp.UnixMilli(),
})
}
if len(ts.Samples) == 0 || ts.Samples[len(ts.Samples)-1].Timestamp < latestTimestamp.UnixMilli() {
ts.Samples = append(ts.Samples, prompb.Sample{
Value: float64(1),
Timestamp: latestTimestamp.UnixMilli(),
})
}
ts.Samples = append(ts.Samples, prompb.Sample{
Value: float64(1),
Timestamp: latestTimestamp.UnixMilli(),
})
}
// convertTimeStamp converts OTLP timestamp in ns to timestamp in ms.