Skip to content

Commit

Permalink
Check name tag as per Mihail's wishes :)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Sep 4, 2020
1 parent 8ee1d1c commit 413d0fe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/netext/httpext/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,16 @@ func (t *transport) measureAndEmitMetrics(unfReq *unfinishedRequest) *finishedRe
}
} else {
urlEnabled := enabledTags.Has(stats.TagURL)
nameEnabled := enabledTags.Has(stats.TagName)
if urlEnabled || nameEnabled {
var setName bool
if _, ok := tags["name"]; !ok && enabledTags.Has(stats.TagName) {
setName = true
}
if urlEnabled || setName {
cleanURL := URL{u: unfReq.request.URL, URL: unfReq.request.URL.String()}.Clean()
if urlEnabled {
tags["url"] = cleanURL
}
if _, ok := tags["name"]; !ok && nameEnabled {
if setName {
tags["name"] = cleanURL
}
}
Expand Down

0 comments on commit 413d0fe

Please sign in to comment.