fix(hcpctl): replace has_any with join in kusto must-gather query to avoid 10,000-argument limit - #6663
Conversation
… log ingestion Signed-off-by: Giulio Frasca <gfrasca@redhat.com>
There was a problem hiding this comment.
Pull request overview
This PR updates an hcpctl must-gather Kusto query template to avoid ADX/Kusto’s has_any() 10,000-argument limit by switching the Maestro “associated resource IDs” filter to a join kind=inner, and adds isnotempty(cluster_id) guards to prevent empty-string matching from over-selecting logs.
Changes:
- Replace
has_any(maestro_resource_ids)with ajoin kind=inner (maestro_resource_ids) on resourceIdfor Maestro associated-resource log selection. - Add
where isnotempty(cluster_id)guards to prevent broad matches whencluster_idis empty. - Update golden fixtures for
hcpctlquery-building tests to reflect the new KQL.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tooling/hcpctl/pkg/kusto/templates/custom/detailed_infra_orchestration_logs.kql.gotmpl | Switch Maestro associated-resource filtering from has_any to join, and add isnotempty(cluster_id) guards. |
| tooling/hcpctl/testdata/zz_fixture_TestBuildMerged_MultipleChildren.yaml | Update expected rendered KQL fixture for merged queries. |
| tooling/hcpctl/testdata/zz_fixture_TestBuildAllCustomQueries.yaml | Update expected rendered KQL fixture for “all custom queries” output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
73ac38f to
09c354f
Compare
09c354f to
ac72f10
Compare
…-argument limit The DEV environment produces >13,000 distinct maestro resource IDs per cluster over a 24-hour window, exceeding Kusto's has_any() limit and failing every e2e run on the kusto_logs_present test. Signed-off-by: Giulio Frasca <gfrasca@redhat.com>
ac72f10 to
e8abf5d
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gmfrasca The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
superceded by #6666 Looks like that PR also addresses the same issue and is a cleaner fix. Will close this pending CI/merge on that one. |
|
Giulio Frasca (@gmfrasca): The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What
Replace
has_any(maestro_resource_ids)with ajoin kind=innerin thedetailedInfraOrchestrationLogsKQL query template. Also addisnotempty(cluster_id)guards as defense-in-depth.Why
The DEV Kusto environment produces >13,000 distinct maestro resource IDs per cluster over a 24-hour query window, exceeding Kusto's
has_any()10,000-element limit. This causes every e2e run to fail on thekusto_logs_presenttest withSEM0026: The arguments array exceeded the allowed limit.The
join kind=innerapproach has no element limit and scales with environment growth. Theisnotempty(cluster_id)guards prevent a secondary failure mode wheretoscalar()returns an empty string andhas ""matches all rows.Testing
TestBuildMerged_MultipleChildrenandTestBuildAllCustomQueriesfixture tests updated and passing.make verify-kql) requires Kusto emulator; will be verified in CI.kusto_logs_presentE2E test which is currently failing across all PRs.Special notes for your reviewer
Investigated via ADX: confirmed ingestion latency is ~3-6 min (not the issue). The root cause is volume — a single cluster's
has cluster_idfilter against 24 hours of maestro logs in the shared DEV environment now yields 13,260 distinct resource IDs, exceedinghas_any()'s hard limit.PR Checklist