Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ def should_sample(
parent_context, trace_id, name, kind, attributes, links, trace_state
)
if result.decision is Decision.DROP:
result = _wrap_result_with_record_only_result(result)
result = _wrap_result_with_record_only_result(result, attributes)
return result

@override
def get_description(self) -> str:
return "AlwaysRecordSampler{" + self._root_sampler.get_description() + "}"


def _wrap_result_with_record_only_result(result: SamplingResult) -> SamplingResult:
def _wrap_result_with_record_only_result(result: SamplingResult, attributes: Attributes) -> SamplingResult:
return SamplingResult(
Decision.RECORD_ONLY,
result.attributes,
attributes,
result.trace_state,
)
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def validate_should_sample(self, root_decision: Decision, expected_decision: Dec
trace_id=0,
name="name",
kind=SpanKind.CLIENT,
attributes={},
attributes={"key": root_decision.name},
trace_state=TraceState(),
)

Expand Down
Loading