bitfab 0.23.5 → 0.23.7
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/client.rb +15 -2
- data/lib/bitfab/span_context.rb +4 -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: fb51dda5edc6e1c4cf5cc439c766b52dad303f3838e5aae80b03cd521fa34d80
|
|
4
|
+
data.tar.gz: a1b21474b8d32f22ed6a17e2ef65d865549fb23d7a25de9cbdfd03e64eb385a5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9dfb2cb3e7eb9f845453f58e807c6150e8136c43fdc5e3aedfb65d89b61027772831775f0a7854559a89be4ddeae7084b6c26195ac165365083309429834057c
|
|
7
|
+
data.tar.gz: '0785322f709aa5dbe67454f7ca743e5def622d9ed6981d4f62b5c222e1e730270bfc727805f7198a4a139d54ea966dc80df194107f1e90b575638f90e7f7a02e'
|
data/lib/bitfab/client.rb
CHANGED
|
@@ -492,7 +492,15 @@ module Bitfab
|
|
|
492
492
|
|
|
493
493
|
def send_span(trace_function_key:, trace_id:, span_id:, parent_span_id:,
|
|
494
494
|
span_name:, span_type:, function_name:, contexts:, prompt:, args:, kwargs:, result:, error:,
|
|
495
|
-
started_at:, ended_at:, test_run_id: nil, input_source_span_id: nil)
|
|
495
|
+
started_at:, ended_at:, test_run_id: nil, input_source_span_id: nil, mocked: false)
|
|
496
|
+
# If drop() was called on this trace, suppress the span PAYLOAD upload for
|
|
497
|
+
# every span that completes after the flag was set. The trace completion
|
|
498
|
+
# still rides out with dropped: true, so the server scrubs any sibling
|
|
499
|
+
# spans that already raced out before the flag was set. Returning nil
|
|
500
|
+
# signals "no span thread" to the caller, which already handles nil.
|
|
501
|
+
trace_dropped = TraceState.get(trace_id)&.dig(:dropped) == true
|
|
502
|
+
return nil if trace_dropped
|
|
503
|
+
|
|
496
504
|
# Human-readable JSON (input/output fields). The *_with_report variants
|
|
497
505
|
# also report what could not be faithfully captured so a lossy span is
|
|
498
506
|
# marked non-replayable below instead of shipping as if it round-trips.
|
|
@@ -539,6 +547,10 @@ module Bitfab
|
|
|
539
547
|
"rawSpan" => raw_span
|
|
540
548
|
}
|
|
541
549
|
payload["testRunId"] = test_run_id if test_run_id
|
|
550
|
+
# Flag spans served from the original trace's recorded output during a
|
|
551
|
+
# replay so the trace view can mark them (matches the Python and
|
|
552
|
+
# TypeScript SDKs).
|
|
553
|
+
payload["mocked"] = true if mocked
|
|
542
554
|
|
|
543
555
|
# A value that could only be captured as a placeholder makes the span
|
|
544
556
|
# non-replayable; record it on the payload's errors (matching the Python
|
|
@@ -636,7 +648,8 @@ module Bitfab
|
|
|
636
648
|
started_at:,
|
|
637
649
|
ended_at:,
|
|
638
650
|
test_run_id:,
|
|
639
|
-
input_source_span_id
|
|
651
|
+
input_source_span_id:,
|
|
652
|
+
mocked: true
|
|
640
653
|
)
|
|
641
654
|
# Mocked spans are always non-root (advance_mock_counter returns nil for
|
|
642
655
|
# root spans, so check_mock_replay never short-circuits them), so the
|
data/lib/bitfab/span_context.rb
CHANGED
|
@@ -87,9 +87,10 @@ module Bitfab
|
|
|
87
87
|
# Silently ignore - never crash the host app
|
|
88
88
|
end
|
|
89
89
|
|
|
90
|
-
# Flag this trace to be dropped
|
|
91
|
-
#
|
|
92
|
-
#
|
|
90
|
+
# Flag this trace to be dropped. Once flagged, spans that complete afterward
|
|
91
|
+
# are not uploaded at all, and the completion POST carries a top-level
|
|
92
|
+
# dropped: true so the server scrubs any payloads that already raced out and
|
|
93
|
+
# marks the trace dropped. Never raises into caller code.
|
|
93
94
|
def drop
|
|
94
95
|
trace_state = get_or_create_trace_state
|
|
95
96
|
trace_state[:dropped] = true
|
data/lib/bitfab/version.rb
CHANGED