Add structured denial telemetry#209
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
DenialEventdataclass and public export viapyisolate.telemetry.DenialEvent. (pyisolate/telemetry.py, exported inpyisolate/__init__.py).PolicyError/PolicyAuthErrorvia a new optionaldenial_eventattribute so callers can inspect the event that caused the raised error. (pyisolate/errors.py).Sandbox.get_denial_events()andSandboxThread.get_denial_events(). (pyisolate/runtime/thread.py,pyisolate/supervisor.py).Sandbox.statsand add Prometheus export of denial aggregates and decision-dimensional denial samples in the metrics exporter. (pyisolate/observability/metrics.py).pyisolate/supervisor.py).docs/protocol.md,tests/test_alerts.py,tests/test_metrics.py).Testing
python -m py_compilewhich succeeded for the modified files.tests/test_alerts.py,tests/test_metrics.py,tests/test_capabilities.py,tests/test_policy_enforcement.py) and the denial-telemetry/metering assertions passed.test_reload_with_cap,test_refresh_passes_compiled_policy,test_module_import_is_lazy). These failures are orthogonal to the telemetry feature and stem from test environment global-state assumptions.Codex Task