-
Notifications
You must be signed in to change notification settings - Fork 2
fix(budgateway): enable graceful degradation for unsupported guardrail providers #756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -163,14 +163,13 @@ impl GuardrailConfig { | |
|
|
||
| for provider in &self.providers { | ||
| if !SUPPORTED_PROVIDERS.contains(&provider.provider_type.as_str()) { | ||
| return Err(crate::error::Error::new( | ||
| crate::error::ErrorDetails::Config { | ||
| message: format!( | ||
| "Unsupported provider type '{}' in guardrail '{}'", | ||
| provider.provider_type, self.id | ||
| ), | ||
| }, | ||
| )); | ||
| // Log warning instead of returning error for unknown providers | ||
| tracing::warn!( | ||
| "Unsupported provider type '{}' in guardrail '{}' - this provider will be skipped during execution", | ||
| provider.provider_type, | ||
| self.id | ||
| ); | ||
| continue; // Skip validation for unsupported providers | ||
| } | ||
|
Comment on lines
165
to
173
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change correctly prevents the application from failing at startup due to an unsupported guardrail provider by logging a warning instead of returning an error. However, the graceful degradation at runtime appears incomplete. The execution logic in To fully implement graceful degradation, consider filtering out unsupported providers before they are executed, for example, within To implement this, you might need to move the |
||
|
|
||
| // Validate that enabled probes are not empty | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
validateimplementation only logs andcontinues for unknown providers, but the providers remain inself.providers. Downstream code (create_probe_tasks→execute_single_probe) still builds probe tasks for every provider and returnsErrorDetails::Config { message: "Unsupported provider type" }when the type is not matched. WithFailureMode::FailFast(the default when executing guardrails), any request that reachesexecute_guardrailwith an unsupported provider will still error at runtime rather than being skipped, so the intended “graceful degradation” never happens and failures merely move from startup to request handling.Useful? React with 👍 / 👎.