Skip to content

Commit 84348eb

Browse files
authored
Do not override host tag in http spans (#145)
1 parent 6dc75c6 commit 84348eb

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

instana/recorder.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def build_registered_span(self, span):
116116
data.custom.logs = logs
117117

118118
if span.operation_name in self.http_spans:
119-
data.http = HttpData(host=self.get_http_host_name(span),
119+
data.http = HttpData(host=span.tags.pop("http.host", None),
120120
url=span.tags.pop(ext.HTTP_URL, None),
121121
params=span.tags.pop('http.params', None),
122122
method=span.tags.pop(ext.HTTP_METHOD, None),
@@ -248,17 +248,6 @@ def build_sdk_span(self, span):
248248

249249
return json_span
250250

251-
def get_http_host_name(self, span):
252-
h = span.tags.pop("http.host", "")
253-
if len(h) > 0:
254-
return h
255-
256-
h = socket.gethostname()
257-
if h and len(h) > 0:
258-
return h
259-
260-
return "localhost"
261-
262251
def get_span_kind_as_string(self, span):
263252
"""
264253
Will retrieve the `span.kind` tag and return the appropriate string value for the Instana backend or

0 commit comments

Comments
 (0)