feat(logs): Kusto Functions Framework #7278
All Vouch review confidence checks passed
Residual risk 0.29 = Change Risk (0.53) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.53 · 459 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.367
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #7278"
general
weight: 0.35
hlipsig
https://redhat.atlassian.net/browse/ARO-30047
What
<!-- Briefly describe what this PR does -->
- get a ResourceID from a ClusterID
- get a ClusterID from a ResourceID
Why
<!-- Briefly explain why this change is needed -->
Consistent log schemas and structure are critical to operational readiness and BU reporting. Providing a framework for these teams to communicate necessities in logs via integration testing allows us to establish a contract for what shouldn't change.
The addition of functions in general also solves many many other issues:
1. Our logs are incredible, but complex. Queries can easily go >100LOC; that's not simple to teach or learn - but writing a single function and executing it is. It also keeps tickets shorter (don't have to scroll past 100LOC of kql in an ICM). I'm sure there are other usability benefits too.
2. Named functions are easier for human eyes to understand, which makes it easier for AI agents to understand as well.
- Having human-verified KQL statements wrapped in a plaintext identifier (name) eliminates hallucinations that are omnipresent in the "just throw AI at Kusto" space (no hallucinated
| where resourceId has "name"junk that can match multiple clusters).- When you give an AI clear inputs/outputs and also hints at what a function does via docstrings and folder organization, you get native discoverability and more precise results
- It's cheaper - well-defined and validated KQL means AI don't need to discover their way through a full kusto schema each time you run a query.
- Not having AI write its own KQL (rather, providing it output of a human-approved KQL statement) is in alignment with Microsoft recommendations for AI use.
4. We can define KQL once for a standard query and reuse it in many ways - same KQL executes for AI agents, dashboards, ICM Automation, or direct human use in kusto - we have a single source of truth that's easily shared.
Testing
This PR introduces a new integration suite (based on the RP one) which validates the KQL we have by spinning up a local container, applying our expected tables and functions, then running a series of tests with sample data and expected results.
While this PR introduces the concept of this test framework, it has no impact on CI (breaking the schema is still possible with green CI). Changing this would require a merge to Prow.
Notes
To review, I'd recommend this order (there's lots here):
1. Check out a basic function definition in the
functionsfolder2. Check out the README at the top-level of the suite - gives an overview of the test architecture as a whole.
3. Look at
manifest.jsonto see how the test suite maps all the Databases, tables, and functions it needs to test (what it puts in the emulator).4. Look at any sub-directory of
artifactsto see what it takes to define a test (spoiler: it's just JSON and particularly named directories/files)5. Pull this PR local - run
make test-integration-kustoto see the suite in action. If you'd like, ask Claude to write up a new function and implement a test to see the dev flow. Asking it to show you step-by-step what to do will be helpful too.6. Look through the rest as you like.