Commit 6f56260
authored
feat: capture Fuseki error bodies into events + server-side filtering for the admin event viewer (#1050)
* feat(triple-store): capture Fuseki error body into TripleStoreError events
HTTP-backed adapters discarded the server response body on failure, so TripleStoreError events only carried a generic "500 Server Error for url ..." string — useless for telling whether a Fuseki 500 is OOM, disk-full or a lock abort.
- Add Exceptions.RequestError (TripleStorePorts) carrying operation, status_code, response_body (truncated to 4KB), endpoint, attempts. Plain-data domain exception so the service layer needs no HTTP-library import.
- ApacheJenaTDB2: read response.text on failure and raise RequestError; the distributed-lock acquire timeout now raises RequestError(operation=acquire_write_lock) instead of a bare RuntimeError.
- TripleStoreService: enrich TripleStoreError.message via exc.detail(); query()/query_view() now emit TripleStoreError on read failures (previously silent).
* feat(nexus): server-side filtering, search and paging for the admin event viewer
The admin event viewer fetched the last 100 events of ALL types then filtered/searched client-side, so rare events (e.g. TripleStoreError) were invisible and the type dropdown only listed whatever was in the loaded sample.
- EventService/EventSQLiteAdapter + ports: add newest_first (ORDER BY seq DESC -> last N matching, via the existing (event_type, seq) index) and search (case-insensitive LIKE over the payload, wildcards escaped). Additive and backward-compatible — cursor readers keep ASC ordering.
- /api/admin/events/recent: add event_class (type URI), q (whole-log search) and before_seq (cursor); limit is applied AFTER the filters so you get the last N of that kind. New /api/admin/events/types lists the full LogProcess registry for the dropdown.
- Web viewer: server-driven type dropdown, debounced server-side search over the whole log, 'Load older' cursor paging; the live poll respects active filters.1 parent 927de67 commit 6f56260
11 files changed
Lines changed: 658 additions & 101 deletions
File tree
- libs
- naas-abi-core/naas_abi_core/services
- event
- adapters/secondary
- triple_store
- adaptors/secondary
- naas-abi/naas_abi/apps/nexus/apps
- api/app/api/endpoints
- web/src/app/workspace/[workspaceId]/admin/events
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
| 65 | + | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
| |||
118 | 125 | | |
119 | 126 | | |
120 | 127 | | |
| 128 | + | |
| 129 | + | |
121 | 130 | | |
122 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
123 | 137 | | |
124 | 138 | | |
125 | 139 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
140 | 147 | | |
141 | 148 | | |
142 | 149 | | |
| |||
147 | 154 | | |
148 | 155 | | |
149 | 156 | | |
| 157 | + | |
| 158 | + | |
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
| |||
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
99 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
100 | 115 | | |
101 | 116 | | |
102 | 117 | | |
| |||
119 | 134 | | |
120 | 135 | | |
121 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
122 | 144 | | |
123 | 145 | | |
124 | 146 | | |
125 | 147 | | |
126 | | - | |
| 148 | + | |
127 | 149 | | |
128 | 150 | | |
129 | 151 | | |
| |||
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
124 | 197 | | |
125 | 198 | | |
126 | 199 | | |
| |||
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
25 | 76 | | |
26 | 77 | | |
27 | 78 | | |
| |||
Lines changed: 43 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
120 | 136 | | |
121 | 137 | | |
122 | 138 | | |
| |||
140 | 156 | | |
141 | 157 | | |
142 | 158 | | |
143 | | - | |
| 159 | + | |
144 | 160 | | |
145 | 161 | | |
146 | 162 | | |
| |||
185 | 201 | | |
186 | 202 | | |
187 | 203 | | |
188 | | - | |
| 204 | + | |
189 | 205 | | |
190 | 206 | | |
191 | 207 | | |
| |||
219 | 235 | | |
220 | 236 | | |
221 | 237 | | |
222 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
223 | 248 | | |
224 | 249 | | |
225 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
226 | 260 | | |
227 | 261 | | |
228 | 262 | | |
| |||
235 | 269 | | |
236 | 270 | | |
237 | 271 | | |
238 | | - | |
| 272 | + | |
239 | 273 | | |
240 | 274 | | |
241 | 275 | | |
| |||
253 | 287 | | |
254 | 288 | | |
255 | 289 | | |
256 | | - | |
| 290 | + | |
257 | 291 | | |
258 | 292 | | |
259 | 293 | | |
| |||
268 | 302 | | |
269 | 303 | | |
270 | 304 | | |
271 | | - | |
| 305 | + | |
272 | 306 | | |
273 | 307 | | |
274 | 308 | | |
| |||
435 | 469 | | |
436 | 470 | | |
437 | 471 | | |
438 | | - | |
| 472 | + | |
439 | 473 | | |
440 | 474 | | |
441 | 475 | | |
| |||
579 | 613 | | |
580 | 614 | | |
581 | 615 | | |
582 | | - | |
| 616 | + | |
583 | 617 | | |
584 | 618 | | |
585 | 619 | | |
| |||
0 commit comments