[DNM] metering: add changefeed traffic reporting foundations - #6205
3AceShowHand wants to merge 4 commits into
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
294e8b4 to
b3e1cfc
Compare
What problem does this PR solve?
Issue Number: ref #6204
Add the foundation for reporting changefeed traffic through Metering SDK. This draft does not yet connect sink accounting, durable metering state, or periodic submission.
What is changed and how it works?
TrafficReporter.Report(ctx, reportedAt, []TrafficRecord)with typed changefeed results, per-call batch identity, bounded retries through the existing retry utility, and explicit upload errors. The reporter does not collect data or assume cumulative accounting semantics./config; retain shared-pool path validation.pkg/metering/trafficand focused tests. Selection, event accumulation, and delivery confirmation belong to callers.server.tomlfile.Remaining work
Sink integration, reliable metering state, periodic submission, the consumption contract, and end-to-end recovery validation are still pending. Repeated Report calls create distinct batches; cross-call recovery and deduplication belong to the producer/consumer contract.
Check List
Tests
go test -p 1 ./pkg/metering -run TestTrafficReporter -count=1: passed.TestMetering*tests passed in the targeted package run.go test -race -p 1 ./pkg/metering ./coordinator -run 'Test(TrafficReporter|Metering)' -count=1: metering passed; coordinator could not build because the local disk ran out of space.go test -p 1 ./pkg/metering/... ./pkg/config ./api ./coordinator -run 'Test(ValidateConfig|Measure|ServerMeteringConfig|RegisterRoutesConfig|Metering)' -count=1: passed after relocating the rules and simplifying configuration handling.git diff --cached --check.Full build and coordinator race coverage remain unverified after earlier disk-space failures. Cloud integration, fault injection, and performance tests have not run.
Questions
Will it cause performance regression or break compatibility?
Metering is disabled by default, and sink execution paths are not connected yet. Configured destinations add coordinator initialization and SDK dependencies. Storage validation follows SDK behavior; some invalid configurations may only fail on upload because the SDK does not provide a unified pre-validation API. No end-to-end performance claim is made.
Do you need to update user documentation, design documentation or monitoring documentation?
User-facing documentation and monitoring will need updates when the complete reporting flow is connected.
Release note