Skip to content

Commit

Permalink
Set status code as string (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelsey authored Dec 9, 2020
1 parent cd18e56 commit 03d1775
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tracing/req_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tracing

import (
"net/http"
"strconv"
"time"

opentracing "github.com/opentracing/opentracing-go"
Expand Down Expand Up @@ -76,7 +77,9 @@ func (rt *RequestTracer) Finish() {
fields["dur"] = dur.String()
fields["dur_ns"] = dur.Nanoseconds()

rt.span.SetTag(ext.HTTPCode, rt.trackingWriter.status)
// Setting the status as an int doesn't propogate for use in datadog dashboards,
// so we convert to a string.
rt.span.SetTag(ext.HTTPCode, strconv.Itoa(rt.trackingWriter.status))
rt.span.Finish()
rt.WithFields(fields).Info("Completed Request")
}
Expand Down

0 comments on commit 03d1775

Please sign in to comment.