Skip to content

Commit

Permalink
fix timestamp parsing form Datadog metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
lgfa29 committed Sep 17, 2020
1 parent ee0f8b0 commit 40a5530
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugins/builtin/apm/datadog/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,15 @@ func (a *APMPlugin) Query(q string, r sdk.TimeRange) (sdk.TimestampedMetrics, er

// pl is [[timestamp, value]...] array
for _, p := range *pl {
if len(p) != 2 {
continue
}

ts := int64(p[0]) / 1e3
value := p[1]
tm := sdk.TimestampedMetric{
Timestamp: time.Unix(int64(p[0]), 0),
Value: p[1],
Timestamp: time.Unix(ts, 0),
Value: value,
}
result = append(result, tm)
}
Expand Down

0 comments on commit 40a5530

Please sign in to comment.