|
17 | 17 |
|
18 | 18 |
|
19 | 19 | class GenericNodeMixin: |
20 | | - def __init__(self, *args, **kwargs): |
21 | | - self.ids = [] |
22 | | - |
23 | 20 | @property |
24 | 21 | def processed_user_attributes(self): |
25 | 22 | if hasattr(self, "_processed_user_attributes"): |
@@ -76,7 +73,7 @@ def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dic |
76 | 73 | u_attrs = self.processed_user_attributes |
77 | 74 | if settings.distributed_tracing.unique_spans.enabled: |
78 | 75 | # ids is the list of span guids that share this unqiue exit span. |
79 | | - u_attrs["nr.ids"] = self.ids |
| 76 | + u_attrs["nr.ids"] = [] |
80 | 77 |
|
81 | 78 | u_attrs = attribute.resolve_user_attributes( |
82 | 79 | u_attrs, settings.attribute_filter, DST_SPAN_EVENTS, attr_class=attr_class |
@@ -108,14 +105,15 @@ def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dic |
108 | 105 | new_exit_span = span_attrs not in ct_exit_spans |
109 | 106 | # If this is a new exit span, add it to the known ct_exit_spans and return it. |
110 | 107 | if new_exit_span: |
111 | | - ct_exit_spans[span_attrs] = [self.ids, i_attrs] |
| 108 | + u_attrs["nr.durations"] = self.duration |
| 109 | + ct_exit_spans[span_attrs] = [u_attrs] |
112 | 110 | ct_processing_time[0] += (time.time() - start_time) |
113 | 111 | return [i_attrs, u_attrs, a_minimized_attrs] if settings.distributed_tracing.minimize_attributes.enabled else [i_attrs, u_attrs, a_attrs] |
114 | 112 | # If this is an exit span we've already seen, add it's guid to the list |
115 | 113 | # of ids on the seen span and return None. |
116 | 114 | # For now add ids to user attributes list |
117 | | - ct_exit_spans[span_attrs][0].append(self.guid) |
118 | | - ct_exit_spans[span_attrs][1]["duration"] += self.duration |
| 115 | + ct_exit_spans[span_attrs][0]["nr.ids"].append(self.guid) |
| 116 | + ct_exit_spans[span_attrs][0]["nr.durations"] += self.duration |
119 | 117 |
|
120 | 118 | ct_processing_time[0] += (time.time() - start_time) |
121 | 119 | return None |
|
0 commit comments