Commit 3c4e189
[clickhouse] Skip emitting empty storage_health payloads (#23553)
* [clickhouse][dbm] Skip emitting empty storage_health payloads
Skip the database_monitoring_query_activity emission when every parts-and-merges
collection (parts, merges, mutations, replication queue, detached parts, thresholds)
is empty. This is the case for fresh ClickHouse Cloud instances with no user data
and restricted system tables, and for transient total-collection-failure scenarios.
Empty storage_health payloads previously wedged dbm-events-processor partitions on
the dd-go side; that processor is being fixed independently in
DataDog/dd-go#234748. This change also avoids emitting one useless Kafka message
per collection cycle for any genuinely-idle/empty instance.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add changelog entry for PR #23553
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add end-to-end test for skipped emission when all collectors return empty
Pins the wiring between _collect_and_emit and _emit_events for the case where
every collection query fails or returns no rows, which is the scenario that
fires when all queries hit exceptions (auth/network) or on a fresh, restricted
ClickHouse Cloud instance.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent bf6a3c5 commit 3c4e189
3 files changed
Lines changed: 42 additions & 1 deletion
File tree
- clickhouse
- changelog.d
- datadog_checks/clickhouse
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
| 821 | + | |
| 822 | + | |
821 | 823 | | |
822 | 824 | | |
823 | 825 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
859 | | - | |
| 859 | + | |
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
863 | 863 | | |
864 | 864 | | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
865 | 880 | | |
866 | 881 | | |
867 | 882 | | |
| |||
907 | 922 | | |
908 | 923 | | |
909 | 924 | | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
910 | 948 | | |
911 | 949 | | |
912 | 950 | | |
| |||
0 commit comments