File tree Expand file tree Collapse file tree
packages/aws-durable-execution-sdk-python-insight
src/aws_durable_execution_sdk_python_insight Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232
3333import datetime
3434import json
35- import logging
3635import math
3736import sys
3837import threading
6261)
6362
6463
65- logger = logging .getLogger (__name__ )
66-
67-
6864# Maps the SDK invocation status onto the record status. A durable execution
6965# suspends (PENDING) while waiting; from the execution's point of view it is
7066# still in flight, so surface it as RUNNING (mirrors the JS STATUS_MAP).
@@ -118,7 +114,6 @@ def _resolve_sampling_rate(rate: float | None) -> float:
118114 # False, x < NaN -> False) and silently sample OUT every execution,
119115 # disabling all instrumentation. Coerce to full sampling instead, which
120116 # matches the JS plugin's treatment of non-finite/invalid rates.
121- logger .warning ("sampling_rate is NaN; falling back to 1.0 (full sampling)" )
122117 return 1.0
123118 if rate < 0 or rate > 1 :
124119 return max (0.0 , min (1.0 , float (rate )))
Original file line number Diff line number Diff line change 1313from __future__ import annotations
1414
1515import datetime
16- import logging
1716from typing import Any
1817
1918from aws_durable_execution_sdk_python .lambda_service import (
@@ -204,19 +203,14 @@ def test_resolve_sampling_rate_nan_fails_open_to_one():
204203 assert _resolve_sampling_rate (float ("nan" )) == 1.0
205204
206205
207- def test_nan_sampling_rate_emits_instead_of_silently_disabling (caplog ):
206+ def test_nan_sampling_rate_emits_instead_of_silently_disabling ():
208207 exporter = CaptureExporter ()
209- with caplog .at_level (
210- logging .WARNING ,
211- logger = "aws_durable_execution_sdk_python_insight.plugin" ,
212- ):
213- plugin = workflow_insight (
214- WorkflowInsightConfig (exporters = [exporter ], sampling_rate = float ("nan" ))
215- )
216- _run (plugin , ops = [_step ("greet" )])
208+ plugin = workflow_insight (
209+ WorkflowInsightConfig (exporters = [exporter ], sampling_rate = float ("nan" ))
210+ )
211+ _run (plugin , ops = [_step ("greet" )])
217212 # A NaN rate must not disable instrumentation: the record is still emitted.
218213 assert len (exporter .records ) == 1
219- assert "sampling_rate is NaN" in caplog .text
220214
221215
222216def test_content_omit_input_output_without_drop_flags ():
You can’t perform that action at this time.
0 commit comments