From 8355dd5c4c789a0e703dde4630d82a20a55becc1 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Tue, 16 Apr 2019 16:24:47 +0200 Subject: [PATCH] Do not override host tag in http spans --- instana/recorder.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/instana/recorder.py b/instana/recorder.py index 10f126fe..975ca9a5 100644 --- a/instana/recorder.py +++ b/instana/recorder.py @@ -116,7 +116,7 @@ def build_registered_span(self, span): data.custom.logs = logs if span.operation_name in self.http_spans: - data.http = HttpData(host=self.get_http_host_name(span), + data.http = HttpData(host=span.tags.pop("http.host", None), url=span.tags.pop(ext.HTTP_URL, None), params=span.tags.pop('http.params', None), method=span.tags.pop(ext.HTTP_METHOD, None), @@ -248,17 +248,6 @@ def build_sdk_span(self, span): return json_span - def get_http_host_name(self, span): - h = span.tags.pop("http.host", "") - if len(h) > 0: - return h - - h = socket.gethostname() - if h and len(h) > 0: - return h - - return "localhost" - def get_span_kind_as_string(self, span): """ Will retrieve the `span.kind` tag and return the appropriate string value for the Instana backend or