bitfab 0.36.1 → 0.36.2
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/http_client.rb +10 -5
- data/lib/bitfab/replay.rb +7 -3
- 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: 44af81a548095fe4bf8a347b6e58bb1c3bdcf2726becd78f029ec5c7c9507ca9
|
|
4
|
+
data.tar.gz: 4a00a95452cf45e5992e7eee4754850923eed8767713368a063fa1fed84d4b7c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9043c05ffb79c8830299127c39de0dc77b77dc3fa1fd2a573813696bcd9a7ba3fa95d7a06a7371ff596ed04781f439311f773bdff24afe055b252b36e0d36bb5
|
|
7
|
+
data.tar.gz: d73327657254114a22c091bb58503c17f1f8d0fcc19f0179c283b452df4c7240d446ff8d36962b16fcc47ea13e0315c80f554280b79f47b684f24ba50b11ce23
|
data/lib/bitfab/http_client.rb
CHANGED
|
@@ -181,9 +181,11 @@ module Bitfab
|
|
|
181
181
|
request("/api/sdk/replay/start", payload, timeout:)
|
|
182
182
|
end
|
|
183
183
|
|
|
184
|
-
# Fetch an external span by ID. Blocking GET request.
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
# Fetch an external span by ID. Blocking GET request. The replay view keeps
|
|
185
|
+
# only the input/output serialization fields used by replay.
|
|
186
|
+
def get_external_span(span_id, replay_view: false)
|
|
187
|
+
query = replay_view ? "?view=replay" : ""
|
|
188
|
+
get("/api/sdk/externalSpans/#{span_id}#{query}", timeout: 30)
|
|
187
189
|
end
|
|
188
190
|
|
|
189
191
|
def get_trace_span(trace_id, id: nil, name: nil, occurrence: "last")
|
|
@@ -210,9 +212,12 @@ module Bitfab
|
|
|
210
212
|
# payloads so only the spans actually mocked are fetched later (by
|
|
211
213
|
# externalSpanId), avoiding dragging down every span's output when only a
|
|
212
214
|
# few are mocked.
|
|
213
|
-
def get_span_tree(external_span_id, include_outputs: true)
|
|
215
|
+
def get_span_tree(external_span_id, include_outputs: true, include_root_output: true)
|
|
214
216
|
endpoint = "/api/sdk/replay/spanTree/#{external_span_id}"
|
|
215
|
-
|
|
217
|
+
query = []
|
|
218
|
+
query << "includeOutputs=false" unless include_outputs
|
|
219
|
+
query << "includeRootOutput=false" unless include_root_output
|
|
220
|
+
endpoint += "?#{query.join("&")}" unless query.empty?
|
|
216
221
|
get(endpoint, timeout: 30)
|
|
217
222
|
end
|
|
218
223
|
|
data/lib/bitfab/replay.rb
CHANGED
|
@@ -676,7 +676,7 @@ module Bitfab
|
|
|
676
676
|
"produce a result that looks valid but did not use the historical data you asked for."
|
|
677
677
|
end
|
|
678
678
|
|
|
679
|
-
span = http_client.get_external_span(original_span_id)
|
|
679
|
+
span = http_client.get_external_span(original_span_id, replay_view: true)
|
|
680
680
|
item_data = extract_span_data(span)
|
|
681
681
|
|
|
682
682
|
# Fetch the span tree when the base strategy needs recorded outputs
|
|
@@ -694,7 +694,11 @@ module Bitfab
|
|
|
694
694
|
mock_tree = nil
|
|
695
695
|
if mock_strategy == "all" || mock_strategy == "marked" || overrides_present
|
|
696
696
|
begin
|
|
697
|
-
tree = http_client.get_span_tree(
|
|
697
|
+
tree = http_client.get_span_tree(
|
|
698
|
+
original_span_id,
|
|
699
|
+
include_outputs:,
|
|
700
|
+
include_root_output: false
|
|
701
|
+
)
|
|
698
702
|
mock_tree = build_mock_tree(tree["root"] || {})
|
|
699
703
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
|
700
704
|
raise if e.is_a?(SystemExit) || e.is_a?(SignalException)
|
|
@@ -843,7 +847,7 @@ module Bitfab
|
|
|
843
847
|
lambda do |external_span_id|
|
|
844
848
|
return cache[external_span_id] if cache.key?(external_span_id)
|
|
845
849
|
|
|
846
|
-
span = http_client.get_external_span(external_span_id)
|
|
850
|
+
span = http_client.get_external_span(external_span_id, replay_view: true)
|
|
847
851
|
span_data = (span["rawData"] || {})["span_data"] || {}
|
|
848
852
|
# Prefer the Ruby Marshal payload (output_serialized) written by this
|
|
849
853
|
# SDK; fall back to another SDK's output_meta, then the raw JSON output.
|
data/lib/bitfab/version.rb
CHANGED