feat: Emit billed DNS usage events - #124
Draft
mattdjenkinson wants to merge 1 commit into
Draft
Conversation
mattdjenkinson
marked this pull request as draft
August 31, 2026 01:45
mattdjenkinson
marked this pull request as ready for review
August 31, 2026 11:11
Contributor
Author
|
@0xmc & @scotwells put this together with an llm but i think it looks right? |
PR #48 published the meter contract. This produces events against those meters: query deltas from PowerDNS protobuf, and inventory gauges from the replicator leader. The writer stamps compact billing identity as PowerDNS DATUM-USAGE metadata so LightningStream edge pods can attribute public queries without DNSZone CRs. Usage is off by default. The Go module moves to 1.26 for the billing SDK. golangci-lint is compiled with that toolchain (install-mode goinstall), and Chainsaw is pinned to v0.2.15 for testing.testDeps.ModulePath. Closes #49
mattdjenkinson
force-pushed
the
feat/dns-usage-pipeline
branch
from
August 31, 2026 11:14
ed12d6f to
31b5e0c
Compare
Contributor
|
Seems like this is using the wrong architecture. We should be using DNSTAP to generate an event stream of DNS queries and using that to create billing data. |
|
@scotwells and @mattdjenkinson pdns recursive supports dnstap, but auth does not (PowerDNS/pdns#7314) |
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.
Summary
PR #48 published the DNS meter contract. This produces events against those meters rather than editing ServiceConfiguration.
The writer-cluster agent counts PowerDNS protobuf responses, maps qnames to hosted zones, and flushes
zone/queriesdeltas through the billing emission SDK. The replicator leader emitszonesandrecords/activegauges so two replicator pods don't both report the same hosted-zone count. Usage is off by default so environments without a Vector Agent stay quiet.Public queries land on LightningStream edge pods that have no DNSZone CRs. The writer stamps compact billing identity as PowerDNS
DATUM-USAGEmetadata, which replicates with the LMDB, so edge collectors can attribute the same way the writer does.cluster-_p-abcbecomesp-abc) so the SDK accepts themupstream-uidare skippedgo.miloapis.com/billingNotes for reviewers
The replicator-milo e2e overlay runs two replicas with leader election off. Enabling usage there would double-bill gauges, so the manager skips InventoryReporter unless
--leader-electis on.golangci-lint-action must use
install-mode: goinstall(notgo) so v2.4.0 is compiled with Go 1.26. Chainsaw is pinned to v0.2.15 for the same toolchain (testing.testDeps.ModulePath).Closes #49