Migrate alerter to azkustodata#1185
Open
mkeesey wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the alerter query engine and related test/mocking code from the legacy kusto client to the newer azkustodata library, aiming to improve HTTP connection cleanup when query results are only partially read.
Changes:
- Replaced legacy
kusto/table.Rowusage withazkustodata/azkustodata/query(azquery.Row) across the alerter query pipeline. - Updated multi-cluster Kusto client to use
IterativeDataset/DatasetAPIs and explicitly close iterative datasets. - Refactored tests and fakes to construct
azquery.Rowvalues and validate row consumption/closure behavior.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| alerter/service.go | Removes legacy kusto interface surface and wires executor to the new multi-kusto client. |
| alerter/rules/store.go | Switches rule statement representation to azkustodata.Statement and kql builder. |
| alerter/multikustoclient/client.go | Implements querying via azkustodata datasets, adds parameter options and row emission logic. |
| alerter/multikustoclient/client_test.go | Reworks tests to use azquery datasets/rows and asserts dataset closure/consumption. |
| alerter/multikustoclient/auth.go | Updates auth configurator types to azkustodata.ConnectionStringBuilder. |
| alerter/lint_test.go | Updates lint fake client to emit azquery.Row without legacy iterator mocking. |
| alerter/fake.go | Removes legacy mock-row iterator logic from the fake alerter Kusto client. |
| alerter/engine/client.go | Updates engine client callback signature to azquery.Row. |
| alerter/engine/context.go | Builds azkustodata.Statement and kql.Parameters for the new query engine. |
| alerter/engine/worker.go | Updates worker handler signatures to consume azquery.Row. |
| alerter/engine/worker_test.go | Updates worker tests for the new row type. |
| alerter/engine/status_test.go | Updates status tests to pass azquery.Row values. |
| alerter/engine/fake.go | Updates fake engine client callback signature for azquery.Row. |
| alerter/engine/executor.go | Updates row parsing and severity conversion to azkustodata/value types. |
| alerter/engine/executor_test.go | Refactors executor tests to build azquery.Row/azvalue values. |
This migrates the alerter query engine to use the updated azkustodata library. Ingestor was migrated several months ago. A primary benefit of the upgrade is better cleanup with partial reads - this library version better propagates result closure to the http layer to prevent partially-read bodies from getting a connection fully stuck.
46f6f86 to
31da330
Compare
| if v < int64(math.MinInt) { | ||
| return math.MinInt | ||
| } | ||
| return int(v) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This migrates the alerter query engine to use the updated azkustodata library. Ingestor was migrated several months ago.
A primary benefit of the upgrade is better cleanup with partial reads - this library version better propagates result closure to the http layer to prevent partially-read bodies from getting a connection fully stuck.