feat(pip): add bundle staleness telemetry constants#44
Merged
Conversation
Add TelemetryBundleStale and ErrorCodeBundleStale constants for the embedded PDP implementation (RFC-005 Appendix B §B.4). - TelemetryBundleStale: emitted when policy bundle exceeds staleness threshold - ErrorCodeBundleStale: distinct from PDP_UNAVAILABLE — PDP evaluated but data may be out of date Part of: EMBEDDED-PDP-001 (PR 1a)
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new telemetry/error-code constants to pkg/pip to support embedded PDP bundle staleness reporting per RFC-005, enabling downstream middleware (e.g., capiscio-server) to distinguish stale-bundle evaluations from PDP unavailability.
Changes:
- Added
TelemetryBundleStale(capiscio.policy.bundle_stale) telemetry field constant. - Added
ErrorCodeBundleStale(BUNDLE_STALE) error code constant for stale-bundle evaluations.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
Adds two telemetry constants for the embedded PDP implementation (RFC-005 Appendix B §B.4):
TelemetryBundleStale(capiscio.policy.bundle_stale) — emitted when the embedded PDP's policy bundle exceeds the staleness thresholdErrorCodeBundleStale(BUNDLE_STALE) — distinct fromPDP_UNAVAILABLE: the PDP evaluated successfully, but the underlying data may be out of dateContext
Task: EMBEDDED-PDP-001 (PR 1a of 5)
Implementation guide:
internal-docs/engineering/embedded-pdp-implementation-guide.mdv1.2Linked PR: capiscio-server
feature/embedded-pdp(PR 1b, depends on this)This is the first PR in the embedded PDP implementation sequence. These constants are consumed by the staleness check in
capiscio-server/internal/api/policy_middleware.go(Step 5 of the implementation guide).Changes
pkg/pip/telemetry.go: AddTelemetryBundleStaleandErrorCodeBundleStaleto the existing telemetry constants blockTesting
go test ./...— 21/21 packages, integration tests excluded as expected)