Skip to content

feat: Emit billed DNS usage events - #124

Draft
mattdjenkinson wants to merge 1 commit into
mainfrom
feat/dns-usage-pipeline
Draft

feat: Emit billed DNS usage events#124
mattdjenkinson wants to merge 1 commit into
mainfrom
feat/dns-usage-pipeline

Conversation

@mattdjenkinson

@mattdjenkinson mattdjenkinson commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

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/queries deltas through the billing emission SDK. The replicator leader emits zones and records/active gauges 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-USAGE metadata, which replicates with the LMDB, so edge collectors can attribute the same way the writer does.

  • Project names strip the Milo leading slash (cluster-_p-abc becomes p-abc) so the SDK accepts them
  • Shadows without upstream-uid are skipped
  • Inventory reporter is not registered when leader election is off
  • Go module and Docker builder move to 1.26 for go.miloapis.com/billing

Notes 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-elect is on.

golangci-lint-action must use install-mode: goinstall (not go) 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

@mattdjenkinson
mattdjenkinson marked this pull request as draft August 31, 2026 01:45
@mattdjenkinson mattdjenkinson self-assigned this Aug 31, 2026
@mattdjenkinson
mattdjenkinson marked this pull request as ready for review August 31, 2026 11:11
@mattdjenkinson

Copy link
Copy Markdown
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
mattdjenkinson force-pushed the feat/dns-usage-pipeline branch from ed12d6f to 31b5e0c Compare August 31, 2026 11:14
@scotwells

Copy link
Copy Markdown
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.

@mattdjenkinson
mattdjenkinson marked this pull request as draft August 31, 2026 11:18
@0xmc

0xmc commented Aug 31, 2026

Copy link
Copy Markdown

@scotwells and @mattdjenkinson pdns recursive supports dnstap, but auth does not (PowerDNS/pdns#7314)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: DNS usage pipeline — emit zone/queries events from PowerDNS to billing

3 participants