Skip to content

Commit 1176f62

Browse files
authored
Merge pull request #26 from instana/fix_entity_reporting
Fix entity reporting in spans.
2 parents 4fae828 + 1fef72b commit 1176f62

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

instana/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class From(object):
1414
pid = ""
15-
hostId = ""
15+
agentUuid = ""
1616

1717
def __init__(self, **kwds):
1818
self.__dict__.update(kwds)

instana/recorder.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,17 @@ def build_registered_span(self, span):
8585
baggage=span.context.baggage,
8686
custom=sd.CustomData(tags=span.tags,
8787
logs=self.collect_logs(span)))
88+
entityFrom = { 'e': self.sensor.agent.from_.pid,
89+
'h': self.sensor.agent.from_.agentUuid }
90+
8891
return sd.InstanaSpan(
8992
n=span.operation_name,
9093
t=span.context.trace_id,
9194
p=span.parent_id,
9295
s=span.context.span_id,
9396
ts=int(round(span.start_time * 1000)),
9497
d=int(round(span.duration * 1000)),
95-
f=self.sensor.agent.from_,
98+
f=entityFrom,
9699
ec=self.get_tag(span, "ec"),
97100
error=self.get_tag(span, "error"),
98101
data=data)
@@ -110,9 +113,9 @@ def build_sdk_span(self, span):
110113
)
111114

112115
sdk_data.Type = self.get_span_kind(span)
113-
114-
data = sd.Data(service=self.get_service_name(span),
115-
sdk=sdk_data)
116+
data = sd.Data(service=self.get_service_name(span), sdk=sdk_data)
117+
entityFrom = { 'e': self.sensor.agent.from_.pid,
118+
'h': self.sensor.agent.from_.agentUuid }
116119

117120
return sd.InstanaSpan(
118121
t=span.context.trace_id,
@@ -121,7 +124,7 @@ def build_sdk_span(self, span):
121124
ts=int(round(span.start_time * 1000)),
122125
d=int(round(span.duration * 1000)),
123126
n="sdk",
124-
f=self.sensor.agent.from_,
127+
f=entityFrom,
125128
data=data)
126129

127130
def get_tag(self, span, tag):

0 commit comments

Comments
 (0)