Skip to content

Commit 03d1775

Browse files
author
Kelsey
authored
Set status code as string (#197)
1 parent cd18e56 commit 03d1775

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tracing/req_tracer.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package tracing
22

33
import (
44
"net/http"
5+
"strconv"
56
"time"
67

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

79-
rt.span.SetTag(ext.HTTPCode, rt.trackingWriter.status)
80+
// Setting the status as an int doesn't propogate for use in datadog dashboards,
81+
// so we convert to a string.
82+
rt.span.SetTag(ext.HTTPCode, strconv.Itoa(rt.trackingWriter.status))
8083
rt.span.Finish()
8184
rt.WithFields(fields).Info("Completed Request")
8285
}

0 commit comments

Comments
 (0)