Skip to content

Add simulation API observability coverage#594

Draft
anth-volk wants to merge 1 commit into
mainfrom
codex/add-observability
Draft

Add simulation API observability coverage#594
anth-volk wants to merge 1 commit into
mainfrom
codex/add-observability

Conversation

@anth-volk

Copy link
Copy Markdown
Contributor

Fixes #593

Summary

  • Add policyengine-observability initialization and structured logging for simulation Modal gateway and worker paths.
  • Keep legacy Logfire enabled while marking it as a candidate for replacement by policyengine-observability.
  • Add granular runtime timing segments, nested segment_tree assertions, handled error recording, and direct Logfire legacy helper tests.
  • Update the simulation API lockfile to resolve policyengine-observability v1.3.0.

Validation

  • uv run pytest tests/test_simulation_output_builder.py tests/test_logfire_legacy.py tests/gateway/test_endpoints.py tests/test_modal_bundle_image.py tests/test_observability.py -q passed: 86 tests.
  • uv run ruff format --check fixtures/gateway/shared.py src/modal/app.py src/modal/budget_window_batch.py src/modal/budget_window_scheduler.py src/modal/gateway/app.py src/modal/gateway/auth.py src/modal/gateway/endpoints.py src/modal/gateway/errors.py src/modal/logfire_legacy.py src/modal/logging_redaction.py src/policyengine_api_simulation/main.py src/policyengine_api_simulation/observability.py src/policyengine_api_simulation/simulation_output_builder.py src/policyengine_api_simulation/simulation_runtime.py tests/gateway/test_endpoints.py tests/gateway/test_errors.py tests/test_logfire_legacy.py tests/test_modal_bundle_image.py tests/test_observability.py tests/test_simulation_output_builder.py passed.
  • git diff --check passed.
  • uv run ruff format --check . still reports pre-existing formatting drift outside this branch in tests/test_dataset_uri.py, tests/test_hf_dataset.py, and tests/test_standalone_simulation_contract.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add observability coverage to the simulation API

1 participant