Skip to content

add availability recording for traffic contracts and virtual keys - #313

Open
noahpodgurski wants to merge 3 commits into
mainfrom
add-availability-traffic-contracts-virtual-keys
Open

noahpodgurski wants to merge 3 commits into
mainfrom
add-availability-traffic-contracts-virtual-keys

Conversation

@noahpodgurski

Copy link
Copy Markdown
Member

What's new

"Traffic contract enforcement failed for "
f"service_type={service_type}: {exc}"
)
if env.TRAFFIC_CONTRACT_FAIL_OPEN_ON_REDIS_ERROR:

@subpath subpath Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion:

I think we need to wrap Redis calls into SLOs too 🙏

We could record it as a failure before raising (with a new TRAFFIC_CONTRACT_UNAVAILABLE reason mapped to FAILURE), and maybe assert it in the 503 test?

just a suggestion from the top of my head, not sure how relevant it is

            record_availability(
                authorized_request, AvailabilityReason.TRAFFIC_CONTRACT_UNAVAILABLE
            )
            raise HTTPException(
                status_code=503,
                detail={"error": "Traffic contract enforcement unavailable."},
            ) from exc

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea, thanks 🙏

This branch has not been deployed

No deployments
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.

2 participants