Skip to content

x/observability/devtools Primer

Experimental — API compatibility is not frozen. Evaluate before adopting in production. Check Release Posture for current maturity status.

Open this page after x/observability Primer when the change is narrowly about development-time debug routes: local profiling endpoints, environment snapshot payloads, development metrics surfacing, or pubsub debug helpers.

x/observability/devtools is a subordinate debug-only package within the x/observability family. Start broader observability work in x/observability before opening this package directly. Devtools must never be mounted in production without an explicit gate.

  • you are adding or modifying a debug route (/_debug/...) for local development inspection
  • you are implementing a runtime or config snapshot payload for development diagnostics
  • you are adding development metrics surfacing at a debug endpoint
  • you are building an environment reload helper for local hot-reload workflows
  • you are adding pubsub debug helpers for inspecting in-process topic state (pubsubdebug/)
  • the work is broader observability infrastructure such as Prometheus exporters or OTel wiring — start from x/observability Primer
  • the change is about protected admin endpoints in production — that belongs in x/observability/ops
  • the work needs stable root entrypoints or core bootstrap changes
  • you intend to mount devtools routes in a production binary without an explicit development gate

First files to read in the current repository

Section titled “First files to read in the current repository”
  1. x/observability/devtools/module.yaml
  2. x/observability/devtools/devtools.go
  3. x/observability/devtools/devcollector.go
  4. x/observability/devtools/pubsubdebug/
Keep it in x/observability/devtools when the work is aboutMove out when the work becomes
devtools.go: debug route registration and handler wiringproduction admin endpoints — that belongs in x/observability/ops
devcollector.go: collecting and surfacing runtime snapshots and config statestable metrics or log root interface changes
Environment reload endpoints for local hot-reload workflowsproduction configuration management or runtime config API
pubsubdebug: inspecting in-process broker state during local developmentproduction broker monitoring or operational diagnostics

Debug tooling is valuable in development but dangerous in production. x/observability/devtools is the explicit home for debug-only routes so that they cannot accidentally migrate into x/observability/ops, x/observability, or core. The invariant is opt-in mounting: devtools routes must be registered explicitly in a development-only wiring path, never via package init or automatic discovery.