Commit 71bd116
add DO queries to postgres check (DataDog#23123)
* Add data_observability config to Postgres
* Add async job
* Ddev update
* Fmt
* initial move to postgres
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
* fix ai issues
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
* move to postgres check
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
* code review updates
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
* Fix test_config and test_config_defaults for DATA_OBSERVABILITY feature
Add DATA_OBSERVABILITY to the expected feature set in
test_initialize_features_enabled_and_disabled and add
the data_observability defaults entry to EXPECTED_DEFAULTS
in test_config_defaults.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
* Strip trailing semicolons before subquery wrapping
Queries with a trailing semicolon would produce invalid SQL when wrapped
in SELECT * FROM (...) _dd_row_limit LIMIT N. Strip trailing semicolons
and whitespace from the query string before constructing the wrapper.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
* Switch query_status gauge to query_executions counter with status tag
Replace gauge(query_status, 1/0) with count(query_executions, 1, status:success/error).
A counter allows computing failure rate over time; a gauge hides flakiness because
a single successful check in a window obscures preceding failures.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
* Remove subquery wrapping; rely on fetchmany for row cap
The SELECT * FROM (...) _dd_row_limit LIMIT N wrapper broke on real RC
queries which have trailing semicolons or trailing -- Datadog {...} comments
appended by the Go handler. Both cause syntax errors inside the subquery.
fetchmany(MAX_RESULT_ROWS) is a sufficient memory safety net on the Python
side. Executing the query as-is avoids all SQL manipulation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
* address code review
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
* fmt
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
* explanation
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
* process grouped queries by db, use per-db conn
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
* run with newer ddev
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
---------
Signed-off-by: mobuchowski <maciej.obuchowski@datadoghq.com>
Co-authored-by: Seth Samuel <seth.samuel@datadoghq.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 7792076 commit 71bd116
12 files changed
Lines changed: 890 additions & 1 deletion
File tree
- postgres
- assets/configuration
- changelog.d
- datadog_checks/postgres
- config_models
- data
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
543 | 542 | | |
544 | 543 | | |
545 | 544 | | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
546 | 642 | | |
547 | 643 | | |
548 | 644 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
124 | 128 | | |
125 | 129 | | |
126 | 130 | | |
| |||
431 | 435 | | |
432 | 436 | | |
433 | 437 | | |
| 438 | + | |
434 | 439 | | |
435 | 440 | | |
436 | 441 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 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 | + | |
114 | 161 | | |
115 | 162 | | |
116 | 163 | | |
| |||
263 | 310 | | |
264 | 311 | | |
265 | 312 | | |
| 313 | + | |
266 | 314 | | |
267 | 315 | | |
268 | 316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
437 | 456 | | |
438 | 457 | | |
439 | 458 | | |
| |||
0 commit comments