You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: config/config.schema.yaml
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -149,6 +149,19 @@ properties:
149
149
description: "Whether to send all traffic to fallback endpoints for this service, regardless of protocol endpoint health."
150
150
type: boolean
151
151
default: false
152
+
sanction_config:
153
+
description: "Configuration for the endpoint sanction system. Controls how long misbehaving endpoints are excluded from selection."
154
+
type: object
155
+
additionalProperties: false
156
+
properties:
157
+
session_sanction_duration:
158
+
description: "Duration that session-based sanctions remain active. Endpoints with session sanctions will be excluded from selection for this duration. Format: Go duration string (e.g., '30m', '1h', '2h'). Default: 1h"
159
+
type: string
160
+
pattern: "^[0-9]+[smh]$"
161
+
cache_cleanup_interval:
162
+
description: "Interval for purging expired sanction entries from the cache. Format: Go duration string (e.g., '5m', '10m'). Default: 10m"
163
+
type: string
164
+
pattern: "^[0-9]+[smh]$"
152
165
# Logger Configuration (optional)
153
166
logger_config:
154
167
description: "Optional configuration for the logger. If not specified, info level will be used."
| `owned_apps_private_keys_hex` | string[] | Only in centralized mode | - | List of 64-character hex-encoded `secp256k1` application private keys |
148
155
| `service_fallback` | array | No | - | Array of service fallback configurations (see below for details) |
156
+
| `sanction_config` | object | No | - | Configuration for endpoint sanction system (see below for details) |
157
+
| `reputation_config` | object | No | - | Configuration for endpoint reputation system (see below for details) |
149
158
150
159
**`service_fallback` (optional)**
151
160
@@ -181,6 +190,94 @@ TODO_DOCUMENT(@adshmh): Update this section to clarify the request distribution
181
190
- **Protocol bypass**: Fallback endpoints bypass protocol-level validation and are sent directly to the configured URLs
182
191
- **Service-specific**: Each service ID can have its own set of fallback endpoints
183
192
193
+
**`sanction_config` (optional)**
194
+
195
+
Configures the endpoint sanction system parameters. The sanction system temporarily excludes misbehaving endpoints from selection. When an endpoint returns errors or behaves poorly, it receives a "session sanction" that prevents it from being selected for requests until the sanction expires.
196
+
197
+
```yaml
198
+
gateway_config:
199
+
# ... other fields ...
200
+
sanction_config:
201
+
session_sanction_duration: "30m" # How long session sanctions last
202
+
cache_cleanup_interval: "5m" # How often to purge expired sanctions
203
+
```
204
+
205
+
| Field | Type | Required | Default | Description |
| `session_sanction_duration` | string | No | "1h" | Duration that session-based sanctions remain active. Format: Go duration string (e.g., "30m", "1h", "2h") |
208
+
| `cache_cleanup_interval` | string | No | "10m" | Interval for purging expired sanction entries from the cache. Format: Go duration string |
209
+
210
+
**Key Features:**
211
+
- **Automatic expiration**: Session sanctions automatically expire after the configured duration
212
+
- **Configurable timing**: Operators can tune sanction duration based on their network conditions
213
+
- **Memory efficient**: Expired sanctions are periodically cleaned up to prevent memory bloat
214
+
215
+
**Use Cases:**
216
+
- **Shorter durations** (e.g., `15m`): Use when endpoints frequently have temporary issues and you want faster recovery
217
+
- **Longer durations** (e.g., `2h`): Use when you want to more aggressively exclude problematic endpoints
218
+
- **Default** (`1h`): Balanced approach suitable for most deployments
219
+
220
+
**`reputation_config` (optional)**
221
+
222
+
Configures the endpoint reputation system. Unlike binary sanctions that simply exclude or include endpoints, the reputation system provides **gradual scoring** based on endpoint reliability patterns over time. This allows for more nuanced endpoint selection and softer handling of temporarily degraded endpoints.
223
+
224
+
```yaml
225
+
gateway_config:
226
+
# ... other fields ...
227
+
reputation_config:
228
+
enabled: true # Enable the reputation system
229
+
storage_type: "memory" # Storage backend (currently only "memory" supported)
230
+
initial_score: 80 # Starting score for new endpoints
231
+
min_threshold: 30 # Score below which endpoints are filtered out
232
+
recovery_timeout: "5m" # Time after which inactive endpoints can be re-evaluated
233
+
```
234
+
235
+
| Field | Type | Required | Default | Description |
| `path_shannon_reputation_signals_total` | Counter | Total signals by service_id, signal_type, endpoint_domain |
268
+
| `path_shannon_reputation_endpoints_filtered_total` | Counter | Endpoints filtered vs allowed by service_id, action, domain |
269
+
| `path_shannon_reputation_score_distribution` | Histogram | Distribution of endpoint scores by service_id |
270
+
| `path_shannon_reputation_errors_total` | Counter | Errors in the reputation system by operation, error_type |
271
+
272
+
**Use Cases:**
273
+
- **Production deployments**: Enable to get gradual endpoint scoring and better resilience
274
+
- **Debugging**: Use metrics to identify consistently problematic endpoints or domains
275
+
- **Tuning**: Adjust `min_threshold` based on your network's reliability patterns
276
+
277
+
:::warning E2E Testing
278
+
When running E2E tests with reputation enabled, ensure `reputation_config.enabled: true` is set in your test configuration (e.g., `e2e/config/.shannon.config.yaml`). Without this, E2E tests will not exercise the reputation code path.
0 commit comments