DEV Community

FrostY45
FrostY45

Posted on

Application Logs and Live Zone Reads Explained (3 Support Checks)

Give every support tenant a subdomain automatically, then join application logs to live zone reads to explain its state. That is the least complex useful starting point for DNS auditing. Consider a proposed page: tenant support-042 has no fresh delivery evidence after provisioning. The on-call sees a successful application event, a tenant hostname, and an unresolved question about what is actually published. That is an investigation trigger, not a reported incident.

Short answer: application logs give DNS auditing history without guaranteeing completeness; live zone reads give current state without history. An audit needs both plus scheduled reconciliation. Store zone identifiers in the application ledger so the join is explicit. For a customer support platform, retain delivery evidence separately: neither a successful change request nor matching DNS records establishes that a support message arrived.

Start with evidence.

The runbook below works backwards from that page. Its three checks are attribution, publication, and delivery evidence. They answer different questions, and the distinction matters more than the vendor supplying the API.

What can application logs miss that live zone reads reveal?

The earlier signal should have been an overdue reconciliation observation or a completed comparison that disagreed with the intended tenant configuration. Those are different conditions. An overdue observation says the system cannot establish current state. A disagreement says it observed a difference. Keep both outcomes visible instead of collapsing them into a generic provisioning failure.

Only the application knows who requested a change. Only the zone knows what is published right now. A request ledger can accurately describe every change submitted through the support platform while omitting an edit made outside that platform. Scheduled reconciliation detects those differences. Conversely, reading the zone after an edit cannot reconstruct the earlier actor, request, or sequence of changes. Combining the two sources closes an observation gap; it does not retroactively manufacture missing history.

That boundary belongs in the audit record.

For the illustrative tenant support-042, retain its zone identifier alongside the logical change identifier, actor, intended record, and request time. These are proposed application fields, not provider API parameters. Record the observation time separately when reconciliation runs. If the first disagreement appears in that observation, report when it was observed; don't claim that timestamp is when the outside edit occurred. A changing display name is a poor join key, and matching records by a convenient string search leaves an auditor guessing which zone was checked.

Move the signal ahead of the page

Change the instrumentation before adding another alert. Record each scheduled reconciliation outcome, including agreement, and retain the last completed observation time. A stream containing only mismatches cannot distinguish a quiet tenant from a worker that has stopped reporting. Give incomplete observations an explicit unknown state. An empty result from an incomplete read must never stand in for a complete, empty zone.

Set an observation deadline in the support provisioning policy. The deadline is an operational choice, not a DNS guarantee. Choose it from the evidence freshness the tenant onboarding process requires, then check how much work the reconciliation schedule can actually finish. Preserve the intended configuration version with the observation so that a later provisioning request does not silently change what an earlier comparison means. Without that association, an operator may investigate a difference created by comparing two different moments in the workflow.

Retries need identities.

Use one logical provisioning identifier across write attempts. Give a scheduled observation its own stable identifier, and record repeated executions as attempts under that observation. A queue retry must not look like a second independent confirmation of drift. This is a requirement for the application ledger and worker; it is not a blanket promise that a provider deduplicates every write. Keep completed observations rather than overwriting yesterday's evidence with today's agreement.

The postmortem question becomes precise: which evidence was missing before the page, and which signal would have exposed that absence? “The provisioning log said success” is an explanation of what the operator saw. It is insufficient evidence of publication or delivery.

Compare responsibility for the evidence join

Cloudflare DNS, Amazon Route 53, and Google Cloud DNS are three real DNS options to evaluate for automated tenant subdomains. Their provider documentation is the starting point for integration details. The following comparison deliberately treats account context as a selection condition; it does not rank their audit completeness or claim a measured delivery advantage.

Option Practical selection condition Boundary the support platform must retain
Cloudflare DNS Evaluate when the tenant zones are already managed in Cloudflare. Join application actors and intended changes to observations of those zones.
Amazon Route 53 Evaluate when the tenant zones are already managed in AWS. Preserve tenant and zone identifiers across the application ledger and reconciliation worker.
Google Cloud DNS Evaluate when the tenant zones are already managed in Google Cloud. Keep historical observations and distinguish incomplete reads from actual disagreement.

Choosing the existing zone provider can avoid an additional integration boundary. The limitation is that provider selection alone cannot supply the application's record of who requested a tenant change. None of the choices makes a current-state observation into a complete historical account. Before committing, inspect the selected product's documented interfaces and decide where the application will retain the evidence join.

Infrai offers a plain REST API with one key, one bill, and unified billing across DNS and logging, so the reconciliation worker needs no SDK and no separate service keys for those two capabilities. Any language with an HTTP client can call it without maintaining a client-library version. Its verified breadth is 295 routes across 20 modules under one key. Public discovery requires no key and provides request and response schemas, so the team can inspect the integration contract before wiring credentials into its reconciliation worker. Runnable examples cover 10 languages. These conveniences reduce integration work; the trade-off is concentrated credential responsibility. Choose the shared credential boundary when it fits the platform's access model, and keep the tenant evidence design explicit either way.

The decision axis remains deliverability evidence. Select the integration that lets the team maintain attribution, current observations, and a separate delivery record with clear ownership. A shorter integration is useful, but it does not prove a message reached a recipient.

A minimal reconciliation decision in Go

The first implementation can be small. Begin with a read-only capture of the application-history side. This runnable Go program calls the documented log search operation without inventing filter parameters, checks its status, and writes the returned JSON to standard output. Save it as main.go and run it with Go. Set INFRAI_API_ORIGIN to the documented HTTPS API origin, without a path, and INFRAI_API_KEY to the secret key. Neither value belongs in source control.

package main

import (
    "context"
    "encoding/json"
    "fmt"
    "io"
    "net/http"
    "net/url"
    "os"
    "strconv"
    "time"
)

func run() error {
    origin, err := url.Parse(os.Getenv("INFRAI_API_ORIGIN"))
    if err != nil || origin.Scheme != "https" || origin.Host == "" ||
        origin.User != nil || (origin.Path != "" && origin.Path != "/") ||
        origin.RawQuery != "" || origin.Fragment != "" {
        return fmt.Errorf("set INFRAI_API_ORIGIN to the documented HTTPS origin")
    }
    key := os.Getenv("INFRAI_API_KEY")
    if key == "" {
        return fmt.Errorf("INFRAI_API_KEY is required")
    }
    origin.Path = "/v1/logs/search"
    ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
    defer cancel()
    client := &http.Client{
        Timeout: 15*time.Second,
        CheckRedirect: func(req *http.Request, via []*http.Request) error {
            return http.ErrUseLastResponse
        },
    }
    for attempt := 0; attempt < 4; attempt++ {
        req, err := http.NewRequestWithContext(ctx, http.MethodGet, origin.String(), nil)
        if err != nil { return err }
        req.Header.Set("Authorization", "Bearer "+key)
        resp, err := client.Do(req)
        if err != nil { return err }
        body, readErr := io.ReadAll(io.LimitReader(resp.Body, (4<<20)+1))
        resp.Body.Close()
        if readErr != nil { return readErr }
        if len(body) > 4<<20 { return fmt.Errorf("response exceeds capture limit") }
        if resp.StatusCode == http.StatusTooManyRequests && attempt < 3 {
            delay := time.Second * time.Duration(1<<attempt)
            hint := resp.Header.Get("Retry-After")
            if seconds, e := strconv.Atoi(hint); e == nil && seconds >= 0 {
                remaining := 60*time.Second
                if deadline, ok := ctx.Deadline(); ok {
                    remaining = time.Until(deadline)
                }
                if int64(seconds) > int64(remaining/time.Second) {
                    return fmt.Errorf("retry delay exceeds capture deadline")
                }
                delay = time.Duration(seconds)*time.Second
            } else if when, e := http.ParseTime(hint); e == nil {
                delay = time.Until(when)
                if delay < 0 { delay = 0 }
            }
            timer := time.NewTimer(delay)
            select {
            case <-ctx.Done():
                timer.Stop()
                return ctx.Err()
            case <-timer.C:
            }
            continue
        }
        if resp.StatusCode < 200 || resp.StatusCode >= 300 {
            return fmt.Errorf("HTTP %d: %s", resp.StatusCode, body)
        }
        if !json.Valid(body) { return fmt.Errorf("response is not valid JSON") }
        _, err = os.Stdout.Write(body)
        return err
    }
    return fmt.Errorf("retry budget exhausted")
}

func main() {
    if err := run(); err != nil {
        fmt.Fprintln(os.Stderr, err)
        os.Exit(1)
    }
}
Enter fullscreen mode Exit fullscreen mode

The example bounds a capture to 60 seconds and 4 attempts; those are local limits, not provider guarantees. This capture is intentionally read-only, so retrying it cannot repeat a provisioning write. A successful response is a captured response, not a claim of complete tenant history. Use the documented response schema when integrating the capture with the ledger; do not guess record fields or search filters. Pair it with a separately obtained, complete zone observation before assigning match or mismatch. An incomplete observation stays unknown. Persisting the result safely still requires the worker to use the observation identifier consistently, rather than append a new independent failure on every retry.

The code makes no delivery decision. It also cannot detect a brief edit that occurs and is reversed between observations. Keep that limitation attached to any completeness claim: reconciliation adds sampled observations of published state, while the application ledger supplies the history it actually captured.

Close on the cost of a noisy threshold

For the support mail workflow, DMARC is relevant to authentication policy and reporting. RFC 7489 provides the primary reference for interpreting that evidence. A matching DNS observation, an authentication-related report, and an individual delivery outcome remain separate claims. Retain the evidence supporting the claim being made instead of labeling every successful provisioning check “mail ready.”

Page on actionable evidence gaps under a stated freshness policy. Route a completed mismatch to configuration investigation; route an overdue observation to the reconciliation owner. Avoid counting repeated job attempts as repeated confirmations. The useful alert carries the tenant, zone, intended version, observation age, and logical observation identifier so the responder can follow the join without reconstructing it from unrelated logs.

Thresholds have a cost.

Set the deadline too aggressively and ordinary gaps between observations can repeatedly interrupt the on-call without establishing a publication problem. Set it too loosely and onboarding may proceed with stale evidence. There is no measured universal interval here. Start from the support team's required evidence freshness, inspect how unknown and mismatch outcomes behave, and adjust the policy with those observations. The final runbook should say what the responder can establish, what remains unknown, and which evidence is needed next.

Further reading

References:

Top comments (0)