Skip to content

Commit

Permalink
Merge branch 'iss-2417-newrelic' into 'dev'
Browse files Browse the repository at this point in the history
newrelic  时间单位错误

See merge request cloudcare-tools/datakit!3236
  • Loading branch information
谭彪 committed Oct 18, 2024
2 parents 2571e41 + e7da461 commit c42fc59
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/plugins/inputs/newrelic/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ func makeRootSpan(idLength int, service string, transaction *transaction) *itrac
AddTag(itrace.TagSpanType, itrace.SpanTypeEntry).
AddTag(itrace.TagSource, inputName).
AddTag(itrace.TagSourceType, itrace.SpanSourceWeb).
Add(itrace.FieldStart, transaction.start()*int64(time.Microsecond), false, false).
Add(itrace.FieldDuration, transaction.duration()*int64(time.Microsecond), false, false).
Add(itrace.FieldStart, transaction.start()*int64(time.Millisecond), false, false).
Add(itrace.FieldDuration, transaction.duration()*int64(time.Millisecond), false, false).
AddTag(itrace.TagSpanStatus, itrace.StatusOk)

if uri, err := url.ParseRequestURI(transaction.url()); err == nil {
Expand Down Expand Up @@ -344,8 +344,8 @@ func makeChildrenSpan(service string, rootStart int64, idLength int, traceID, pa
AddTag(itrace.TagSpanType, itrace.SpanTypeLocal).
AddTag(itrace.TagSource, inputName).
AddTag(itrace.TagSourceType, itrace.SpanSourceWeb).
Add(itrace.FieldStart, (rootStart+child.startElapsed())*int64(time.Microsecond), false, false).
Add(itrace.FieldDuration, (child.endElapsed()-child.startElapsed())*int64(time.Microsecond), false, false).
Add(itrace.FieldStart, (rootStart+child.startElapsed())*int64(time.Millisecond), false, false).
Add(itrace.FieldDuration, (child.endElapsed()-child.startElapsed())*int64(time.Millisecond), false, false).
AddTag(itrace.TagSpanStatus, itrace.StatusOk)

if child.method() == "InvokeService" {
Expand Down

0 comments on commit c42fc59

Please sign in to comment.