bitfab 0.78.10 → 0.78.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bitfab/subtree.rb +15 -1
- data/lib/bitfab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 61f325bf163155e9ff6ddb649a5ad1cb3f8687ab3bff887a725a7f6eecc72e6a
|
|
4
|
+
data.tar.gz: e2b85c43fc71385d12dca8228e323412a011eaa28c9369288c752e36f4e61889
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c51c4cbd52cc57f2da4101d82d480e750dd1390c300720826606d6b7110932ccd3cedb4e0a4a493c638f4c36ca5296f1d97e5a943ddd1e82e78620eb30d22d4
|
|
7
|
+
data.tar.gz: b180018b46bc7c4da55216af1fbfb893cc1b08d8dca57577af2b68bef48f4ef9092e201f977530c6911dab64525e213d43fd9a68a63871842a848d87f4c95ec2
|
data/lib/bitfab/subtree.rb
CHANGED
|
@@ -63,7 +63,8 @@ module Bitfab
|
|
|
63
63
|
:prompt,
|
|
64
64
|
:metadata,
|
|
65
65
|
:jev_started_at,
|
|
66
|
-
:jev_recorded_below
|
|
66
|
+
:jev_recorded_below,
|
|
67
|
+
:nearest_captured_ancestor_span_id
|
|
67
68
|
)
|
|
68
69
|
|
|
69
70
|
module_function
|
|
@@ -607,6 +608,7 @@ module Bitfab
|
|
|
607
608
|
entry = OpenSpan.new(
|
|
608
609
|
span_id: SecureRandom.uuid,
|
|
609
610
|
parent_span_id: current_parent_span_id,
|
|
611
|
+
nearest_captured_ancestor_span_id: nearest_captured_ancestor_span_id(@stacks[Fiber.current.object_id] || [], Fiber.current.object_id),
|
|
610
612
|
name:, span_type: type, args:, kwargs:, experiment_id:, started_at: now,
|
|
611
613
|
span_data: {}, declared_node: true
|
|
612
614
|
)
|
|
@@ -638,6 +640,7 @@ module Bitfab
|
|
|
638
640
|
parent = @fiber_parents[parent_fiber_id]
|
|
639
641
|
@fiber_parents[fiber_id] = {
|
|
640
642
|
span_id: stack.reverse_each.find { |entry| entry.span_id }&.span_id || parent&.dig(:span_id) || @root_span_id,
|
|
643
|
+
nearest_captured_ancestor_span_id: nearest_captured_ancestor_span_id(stack, parent_fiber_id),
|
|
641
644
|
depth: local_depth(stack) + parent&.dig(:depth).to_i
|
|
642
645
|
}
|
|
643
646
|
end
|
|
@@ -750,6 +753,7 @@ module Bitfab
|
|
|
750
753
|
identity: metadata.identity,
|
|
751
754
|
span_id:,
|
|
752
755
|
parent_span_id:,
|
|
756
|
+
nearest_captured_ancestor_span_id: nearest_captured_ancestor_span_id(stack, fiber_id, active_parent_span_id),
|
|
753
757
|
name: metadata.name,
|
|
754
758
|
args:,
|
|
755
759
|
kwargs:,
|
|
@@ -836,6 +840,7 @@ module Bitfab
|
|
|
836
840
|
trace_id: @trace_id,
|
|
837
841
|
span_id: entry.span_id,
|
|
838
842
|
parent_span_id: entry.parent_span_id,
|
|
843
|
+
nearest_captured_ancestor_span_id: entry.nearest_captured_ancestor_span_id,
|
|
839
844
|
span_name: entry.name,
|
|
840
845
|
span_type: entry.span_type || "function",
|
|
841
846
|
instrumentation: "trace",
|
|
@@ -859,6 +864,15 @@ module Bitfab
|
|
|
859
864
|
nil
|
|
860
865
|
end
|
|
861
866
|
|
|
867
|
+
def nearest_captured_ancestor_span_id(stack, fiber_id, active_parent_span_id = nil)
|
|
868
|
+
stack.reverse_each.find { |entry| entry.span_id && sent_on_completion?(entry) }&.span_id ||
|
|
869
|
+
@fiber_parents.dig(fiber_id, :nearest_captured_ancestor_span_id) || active_parent_span_id || @root_span_id
|
|
870
|
+
end
|
|
871
|
+
|
|
872
|
+
def sent_on_completion?(entry)
|
|
873
|
+
entry.is_a?(Boundary) || entry.declared_node == true || !content_off?(entry.name)
|
|
874
|
+
end
|
|
875
|
+
|
|
862
876
|
def inputs(event)
|
|
863
877
|
args = []
|
|
864
878
|
kwargs = {}
|
data/lib/bitfab/version.rb
CHANGED