flashman
← All posts

JSON config drift between environments: find the real change

Debug JSON config drift by formatting and diffing redacted environment files before blaming deploy scripts, feature flags, or API code paths in production.

2026-06-25 · 5 min read · Rahul Chitturi

  • json
  • config
  • debugging

Environment-specific JSON config is easy to trust until staging and production behave differently. A feature flag, endpoint URL, timeout, or nested permission list can drift by one value while the deploy pipeline still looks healthy.

Treat config as data. Capture the exact files or API payloads loaded by each environment, redact secrets, normalize formatting, and compare structure before changing application code.

Normalize before diffing

Whitespace and key order can hide the important change. Pretty-print both JSON documents with the same indentation before comparing them. If the source started as YAML, convert it to JSON first so anchors, comments, and implicit types do not distract from the runtime shape.

  • Remove secrets but keep placeholder keys so structure remains comparable
  • Replace volatile timestamps and build IDs with stable markers
  • Use consistent indentation before opening a side-by-side diff
  • Compare the deployed artifact, not only the source file in git

Look beyond top-level flags

The visible flag may only be the symptom. Nested arrays, regional endpoints, retry limits, CORS origins, and auth audience values can change behavior without changing the feature name. Expand collapsed objects and scan the path around each difference.

  • API base URLs and region-specific hosts
  • JWT audience, issuer, and scope configuration
  • Timeouts, retry counts, and queue names
  • Boolean flags that changed type from true to "true"

Write down the invariant

Once the drift is found, record which fields must match across environments and which fields are intentionally different. That turns a one-off incident into a checklist for future deploy reviews and automated config validation.

For risky changes, save the redacted before and after diff in the ticket so reviewers can see exactly what moved.

A Flashman workflow

Format both JSON blobs, convert YAML input when necessary, then use the diff tool to compare redacted values. This works well for API responses, feature flag exports, Terraform outputs, and deployment manifests that should only differ in a few documented places.

Because Flashman runs locally in the browser, the workflow is safer for internal hostnames and tenant IDs than uploading raw config to a remote formatter. Still redact credentials before sharing screenshots or tickets.

Try these tools