Skip to content

Commit d8ec579

Browse files
fix(docs): correct metrics, WAF, and events payloads in proxy registration guide
E2E testing revealed three inaccurate curl examples: - Batch events used invalid event_types (must be one of: config_reload, bundle_switch, error, startup, shutdown, warning, info) - Metrics endpoint requires service_id/project_id, not free-form k/v - WAF events endpoint requires rule_type, rule_id, and action fields All examples now verified against the running control plane with zero error logs.
1 parent f48fd68 commit d8ec579

1 file changed

Lines changed: 51 additions & 4 deletions

File tree

docs/PROXY-REGISTRATION.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ Registered proxies can send operational data back to the control plane:
178178

179179
### Events
180180

181+
Valid event types: `config_reload`, `bundle_switch`, `error`, `startup`, `shutdown`, `warning`, `info`.
182+
Valid severities: `debug`, `info`, `warn`, `error`.
183+
181184
```bash
182185
curl -X POST http://localhost:4000/api/v1/nodes/NODE_ID/events \
183186
-H "Authorization: Bearer TOKEN" \
@@ -197,21 +200,65 @@ curl -X POST http://localhost:4000/api/v1/nodes/NODE_ID/events \
197200
-H "Content-Type: application/json" \
198201
-d '{
199202
"events": [
200-
{"event_type": "config_applied", "severity": "info", "message": "Bundle v1.2.3 applied"},
201-
{"event_type": "health_check", "severity": "info", "message": "All upstreams healthy"}
203+
{"event_type": "bundle_switch", "severity": "info", "message": "Switched to bundle v1.2.3"},
204+
{"event_type": "info", "severity": "info", "message": "All upstreams healthy"}
202205
]
203206
}'
204207
```
205208

206209
### Metrics
207210

211+
Service-level metrics require `service_id` and `project_id`. These are structured metric snapshots, not free-form key-value pairs:
212+
208213
```bash
209214
curl -X POST http://localhost:4000/api/v1/nodes/NODE_ID/metrics \
210215
-H "Authorization: Bearer TOKEN" \
211216
-H "Content-Type: application/json" \
212217
-d '{
213-
"metrics": [{"metric": "requests_total", "value": 150000}],
214-
"request_logs": [{"timestamp": "2026-02-23T10:00:00Z", "method": "GET", "path": "/api/health", "status": 200, "duration_ms": 5}]
218+
"metrics": [{
219+
"service_id": "SERVICE_UUID",
220+
"project_id": "PROJECT_UUID",
221+
"period_start": "2026-02-23T10:00:00Z",
222+
"period_seconds": 60,
223+
"request_count": 1500,
224+
"error_count": 3,
225+
"status_2xx": 1450,
226+
"status_4xx": 47,
227+
"status_5xx": 3
228+
}],
229+
"request_logs": [{
230+
"service_id": "SERVICE_UUID",
231+
"project_id": "PROJECT_UUID",
232+
"timestamp": "2026-02-23T10:00:00Z",
233+
"method": "GET",
234+
"path": "/api/health",
235+
"status": 200,
236+
"latency_ms": 5
237+
}]
238+
}'
239+
```
240+
241+
### WAF Events
242+
243+
WAF events require `rule_type`, `rule_id`, `action`, and `severity`:
244+
245+
```bash
246+
curl -X POST http://localhost:4000/api/v1/nodes/NODE_ID/waf-events \
247+
-H "Authorization: Bearer TOKEN" \
248+
-H "Content-Type: application/json" \
249+
-d '{
250+
"events": [{
251+
"rule_type": "crs",
252+
"rule_id": "942100",
253+
"action": "blocked",
254+
"severity": "warn",
255+
"client_ip": "1.2.3.4",
256+
"method": "POST",
257+
"path": "/login",
258+
"timestamp": "2026-02-23T10:00:00Z",
259+
"matched_data": "1 OR 1=1",
260+
"metadata": {"category": "sql_injection"}
261+
}]
215262
}'
216263
```
217264

0 commit comments

Comments
 (0)