feat: add DNS ServiceConfiguration for metering#48
Open
kevwilliams wants to merge 2 commits into
Open
Conversation
Declare DNS metering as a services.miloapis.com/ServiceConfiguration
(Phase 2 of the catalog registration). Meters three signals:
- zone/queries (Delta, {query}) -- authoritative query volume, the
primary consumption signal, dimensioned by rcode/record_type/location
- zone/hosted (Gauge, {zone}) -- active hosted-zone footprint
- recordset/active (Gauge, {recordset}) -- managed record-set inventory
Monitored resource types DNSZone and DNSRecordSet, billing routing wired
to both. The services-operator fans this out into MeterDefinition and
MonitoredResourceType billing CRDs. Ships Published in the same
components/service-catalog bundle, so infra's existing Flux Kustomization
picks it up automatically.
Emitting zone/queries events from the PowerDNS data plane remains as
follow-up usage-pipeline work.
5 tasks
scotwells
reviewed
Jun 9, 2026
Comment on lines
+61
to
+68
| - name: dns.networking.miloapis.com/recordset/active | ||
| displayName: Active DNS Record Sets | ||
| description: Record sets under management (gauge, 1 per active DNSRecordSet). | ||
| kind: Gauge | ||
| unit: "{recordset}" | ||
| dimensions: | ||
| - record_type | ||
| - location |
Contributor
There was a problem hiding this comment.
Is record set important? I think it would be more valuable to track active number of records.
Contributor
Author
There was a problem hiding this comment.
Switched this to dns.networking.miloapis.com/records/active but also moved it to DNSZone to use Status.RecordCount (sum of all len(spec.records) across its record sets), so the gauge value comes from there. Dropped DNSRecordSet as a monitored resource type entirely since we're not billing per-set.
Comment on lines
+54
to
+60
| - name: dns.networking.miloapis.com/zone/hosted | ||
| displayName: Hosted DNS Zones | ||
| description: Active hosted-zone footprint (gauge, 1 per active DNSZone). | ||
| kind: Gauge | ||
| unit: "{zone}" | ||
| dimensions: | ||
| - location |
Contributor
There was a problem hiding this comment.
I think we could do dns.networking.miloapis.com/zones?
Contributor
Author
There was a problem hiding this comment.
✔️ renamed to dns.networking.miloapis.com/zones
- Rename zone/hosted → zones (simpler name) - Replace recordset/active with records/active, attributed to DNSZone - Drop DNSRecordSet monitored resource type; all metrics now route through DNSZone, sourcing record count from Status.RecordCount which the zone controller already maintains
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
Phase 2 of the catalog registration (#44) — adds the DNS
ServiceConfiguration(services.miloapis.com/v1alpha1) declaring metering. The services-operator fans this single document out intobilling.miloapis.com/MeterDefinition+MonitoredResourceTypeCRDs.Tailored to DNS consumption (authoritative query traffic + managed inventory), not the edge proxy's request/byte counts.
Metrics
dns.networking.miloapis.com/zone/queries{query}rcode,record_type,locationdns.networking.miloapis.com/zone/hosted{zone}dns.networking.miloapis.com/recordset/active{recordset}Monitored resource types:
DNSZone(queries + hosted) andDNSRecordSet(inventory), with billing routing wired to both.Delivery
Ships
phase: Publishedin the sameconfig/components/service-catalogbundle as the Service, so infra's existingdns-operator-milo-service-catalogFlux Kustomization picks it up automatically on the next staging reconcile — no infra change needed.Immutability
Once Published,
metrics[].name/.kind/.unitandmonitoredResourceTypes[].type/.gvkare immutable; renames/unit changes ship as a new metric name (.../v2).Verification
kubectl kustomize config/components/service-catalogbuilds both Service + ServiceConfigurationFollow-up
Declaring
zone/queriesis the metering contract; actually emitting query events from the PowerDNS data plane (collection source, per-tenant attribution, CloudEvents) is the remaining usage-pipeline work.