Skip to content

Commit

Permalink
fix: 修复日志自定义指标上报数据格式清洗兼容问题 (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiandongx authored Dec 4, 2023
1 parent 0201409 commit 290f8bf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/transfer/template/etl/timeseriesv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ func (p *TimeseriesV2Handler) Process(d define.Payload, outputChan chan<- define
// 兼容逻辑
// 日志指标上报存在一种看起来像自定义指标但实际上又不是自定义指标的数据格式
for i := 0; i < len(records.Data); i++ {
item := records.Data[i]
if item.Timestamp == nil {
item.Timestamp = records.Timestamp
if records.Data[i].Timestamp == nil {
records.Data[i].Timestamp = records.Timestamp
}
if item.Target == "" {
item.Target = records.Target
if records.Data[i].Target == "" {
records.Data[i].Target = records.Target
}
}

Expand Down

0 comments on commit 290f8bf

Please sign in to comment.