Commit 881ea52
telemetry: schema validation, current vs lifetime Instance statistics
Address the next round of the architectural review on the telemetry feature.
Rename the reporter/ directory to telemetry/ to match what the feature is
called since the telemetry.* settings rename.
The report now carries a schema_version and the collector validates every
payload against the exact schema belonging to that version, on top of the
existing generic sanity limits: all sections and counters must be present, no
other keys are accepted anywhere and every value must have the expected type.
An arbitrary well-formed JSON object no longer makes it to disk, and any
change to the report structure requires incrementing the version and teaching
the collector the new schema.
Rows of removed Instances are kept in the database, so both current and
lifetime statistics can be reported, and they mean different things. The
instances section is now split in two: "current" covers the non-removed rows
in any state, Destroyed Instances that have not been expunged yet included,
while "lifetime" also counts the removed rows and therefore describes every
Instance which ever existed in the cloud, as total/removed counts plus
hypervisor and type counters.
Document in the README that the installation ID is not guaranteed globally
unique but a collision is negligible (two databases created with the same
version in the same second), that a cloned or restored database intentionally
reports as the same installation, and that the collector cannot verify a
report was genuinely produced by a Management Server: the source is open, so
the statistics are best-effort by nature, with validation, rate limiting and
the per-ID storage bound limiting abuse.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 733611c commit 881ea52
7 files changed
Lines changed: 302 additions & 48 deletions
File tree
- server/src
- main/java/org/apache/cloudstack/report
- test
- java/org/apache/cloudstack/report
- resources
- telemetry
Lines changed: 56 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
82 | 90 | | |
83 | 91 | | |
84 | 92 | | |
| |||
353 | 361 | | |
354 | 362 | | |
355 | 363 | | |
356 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
357 | 373 | | |
358 | | - | |
| 374 | + | |
359 | 375 | | |
360 | 376 | | |
361 | 377 | | |
362 | 378 | | |
363 | 379 | | |
364 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
365 | 388 | | |
366 | | - | |
| 389 | + | |
367 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
368 | 406 | | |
369 | 407 | | |
370 | 408 | | |
| |||
381 | 419 | | |
382 | 420 | | |
383 | 421 | | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
389 | 436 | | |
390 | 437 | | |
391 | 438 | | |
| |||
450 | 497 | | |
451 | 498 | | |
452 | 499 | | |
| 500 | + | |
453 | 501 | | |
454 | 502 | | |
455 | 503 | | |
| |||
Lines changed: 66 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
219 | 236 | | |
220 | 237 | | |
221 | 238 | | |
| |||
266 | 283 | | |
267 | 284 | | |
268 | 285 | | |
| 286 | + | |
269 | 287 | | |
270 | 288 | | |
271 | 289 | | |
| |||
349 | 367 | | |
350 | 368 | | |
351 | 369 | | |
| 370 | + | |
352 | 371 | | |
353 | 372 | | |
354 | 373 | | |
| |||
416 | 435 | | |
417 | 436 | | |
418 | 437 | | |
419 | | - | |
420 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
421 | 441 | | |
422 | 442 | | |
423 | 443 | | |
| |||
482 | 502 | | |
483 | 503 | | |
484 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
485 | 510 | | |
486 | 511 | | |
487 | 512 | | |
488 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
489 | 518 | | |
490 | 519 | | |
491 | | - | |
| 520 | + | |
492 | 521 | | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
498 | 542 | | |
499 | 543 | | |
500 | 544 | | |
| |||
503 | 547 | | |
504 | 548 | | |
505 | 549 | | |
506 | | - | |
| 550 | + | |
507 | 551 | | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
512 | 556 | | |
513 | 557 | | |
514 | 558 | | |
| |||
562 | 606 | | |
563 | 607 | | |
564 | 608 | | |
565 | | - | |
| 609 | + | |
| 610 | + | |
566 | 611 | | |
567 | 612 | | |
568 | 613 | | |
569 | 614 | | |
570 | 615 | | |
571 | 616 | | |
572 | 617 | | |
573 | | - | |
| 618 | + | |
574 | 619 | | |
575 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
576 | 624 | | |
577 | 625 | | |
578 | 626 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
83 | 98 | | |
84 | 99 | | |
85 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
63 | 70 | | |
64 | 71 | | |
65 | 72 | | |
| |||
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
78 | 100 | | |
79 | 101 | | |
80 | 102 | | |
| |||
104 | 126 | | |
105 | 127 | | |
106 | 128 | | |
107 | | - | |
| 129 | + | |
108 | 130 | | |
109 | 131 | | |
110 | 132 | | |
| |||
File renamed without changes.
0 commit comments