feat: expose retryable scheduler outcome telemetry#833
Conversation
Greptile SummaryThis PR adds fine-grained telemetry for retryable scheduler outcomes in
|
| Filename | Overview |
|---|---|
| packages/data-designer-engine/src/data_designer/engine/dataset_builders/async_scheduler.py | Adds four new instance fields, a retryable_outcome_metrics property, and two static helpers. Updates _record_retryable_outcome to classify outcomes, populate counters, walk the exception chain safely, and emit deduplicated per-category warnings. Logic is correct; parallel deques are kept in sync; no provider text leaks into counters or logs. |
| packages/data-designer-engine/tests/engine/dataset_builders/test_async_scheduler.py | Adds 10 new test cases covering parametrized exception-class classification, suppressed-context ProviderError HTTP metadata extraction, and non-retryable-failure vs success categorization. Tests also assert deferred_tasks placement and verify no sensitive text leaks into metrics or logs. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["_record_retryable_outcome(retryable, exc)"] --> B{retryable?}
B -- yes --> C["_retryable_error_kind(exc)"]
B -- no --> D{exc is not None?}
D -- yes --> E["kind = non_retryable_failure"]
D -- no --> F["kind = success"]
C --> G["_retryable_outcome_counts[kind] += 1"]
E --> G
F --> G
C --> H["_provider_error_details(exc) walk chain"]
H --> I["_retryable_detail_counts[kind:http_N] += 1"]
H --> J{kind in _logged_retryable_kinds?}
J -- no --> K["logger.warning + add to set"]
J -- yes --> L["skip"]
G --> M{window disabled?}
M -- yes --> N["return"]
M -- no --> O["append to both deques"]
O --> P{threshold met?}
P -- yes --> Q["degraded provider warning"]
P -- no --> R["return"]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A["_record_retryable_outcome(retryable, exc)"] --> B{retryable?}
B -- yes --> C["_retryable_error_kind(exc)"]
B -- no --> D{exc is not None?}
D -- yes --> E["kind = non_retryable_failure"]
D -- no --> F["kind = success"]
C --> G["_retryable_outcome_counts[kind] += 1"]
E --> G
F --> G
C --> H["_provider_error_details(exc) walk chain"]
H --> I["_retryable_detail_counts[kind:http_N] += 1"]
H --> J{kind in _logged_retryable_kinds?}
J -- no --> K["logger.warning + add to set"]
J -- yes --> L["skip"]
G --> M{window disabled?}
M -- yes --> N["return"]
M -- no --> O["append to both deques"]
O --> P{threshold met?}
P -- yes --> Q["degraded provider warning"]
P -- no --> R["return"]
Reviews (4): Last reviewed commit: "test: cover retryable provider status te..." | Re-trigger Greptile
Code Review — PR #833: Expose retryable scheduler outcome telemetryAuthor: danecor (Dane) · Base: SummaryThe PR enriches
The privacy-conscious design (metadata-only extraction, explicit leak-check test) is the strongest part of this change and aligns well with the "don't leak provider error messages or request data" goal in the PR description. Findings1.
|
Signed-off-by: Dane Corneil <dcorneil@nvidia.com>
Signed-off-by: Dane Corneil <dcorneil@nvidia.com>
Signed-off-by: Dane Corneil <dcorneil@nvidia.com>
Summary
Why
Clients need to distinguish provider backpressure from slow or unhealthy inference so they can tune concurrency and timeouts without treating retryable row outcomes as fatal dataset failures. Accurate success and non-retryable-failure counts also prevent permanent failures from being hidden in operational telemetry.
Validation
uv run --group dev pytest packages/data-designer-engine/tests/engine/dataset_builders/test_async_scheduler.py -k "retryable_outcome_metrics or degraded_provider_warn" -q— 11 passedmake check-engine— 328 files formatted; Ruff cleanmake test-engine— 2,215 passedSupersedes #831 with the implementation ported to Data Designer v0.8.0 and hardened from review feedback.