Technical Debt — Observability & Tracing Gaps

By Engineering Team•September 24, 2026•4 min read
Metadata Details
System Platform-Wide Observability & Distributed Tracing
Document ID TD-2026-OBS-001
Author Engineering Team
Status Open

This document tracks known implementation gaps in the tracing contract as first-class, ongoing debt items — not as passing “not implemented” notes inside the requirements or architecture docs. SR-003 and the architecture doc link here rather than restating the gap detail.


TD-01 — gRPC-originated Pub/Sub publishes get an empty correlation_id

  • Status: Open
  • Severity: Medium — the trace still connects via traceparent (OTel context is unaffected), but the one identifier meant to be “guaranteed the same value on both sides of any hop” (per the central rule’s own rule of thumb) is silently empty for this specific path, breaking a support/on-call agent’s ability to search by correlation_id alone for an operation that started as a gRPC call.
  • Affected component: rust_lang_core_lib::pubsub::current_message_header, and any Rust gRPC handler that publishes a Pub/Sub message directly from within that handler — confirmed in payment-service’s create_payment_order (a gRPC-invoked handler that publishes a document-audit event).
  • Evidence: rust-lang-core-lib/src/src/pubsub/publisher.rs (lines 26–32) carries its own doc comment: “correlation_id is only ever populated on the REQUEST_CONTEXT task-local by the HTTP/Axum request_logger middleware — a gRPC handler … has correlation_id as a tracing span field only …, which get_correlation_id() cannot read back. Calling this from a gRPC-originated context yields an empty correlation_id until a gRPC-side task-local equivalent exists.” Independently confirmed in rust-lang-core-lib/CLAUDE.md’s own description of current_message_header, which states the same gap explicitly as “Flagged, not silently swallowed.”
  • Impact: a document-audit Pub/Sub envelope published from payment-service’s gRPC-invoked create_payment_order (as opposed to its Axum-hosted Razorpay webhook handler) carries traceparent but an empty correlation_id — the resulting document_track/audit record for that specific transaction cannot be found via a correlation_id search, only via traceparent or its own transaction_id.
  • Remediation direction: build a gRPC-side task-local (or span-field read-back) equivalent to the HTTP/Axum REQUEST_CONTEXT task-local that get_correlation_id() currently reads, so current_message_header can resolve correlation_id identically regardless of whether the calling context is HTTP or gRPC. This is scoped to rust-lang-core-lib’s pubsub/request_logger/grpc::server modules — no publisher-side change is needed once fixed.
  • Related requirement: SR-003 NFR-03

TD-02 — Node’s runWithRequestContext wrapping has no codegen safety net

  • Status: Open
  • Severity: Low — no known production incident yet; a structural risk rather than an observed failure.
  • Affected component: every NestJS service/repository/controller method in tenant-migration/tenant-migration-orchestrator and any future Node service built on node-lang-core-lib.
  • Evidence: node-lang-core-lib/CLAUDE.md’s own “Known gaps” list states directly: “No gowrap-equivalent tracing-decorator codegen — runWithRequestContext calls are added by hand at each layer boundary.” Go’s otel.WithSpan[T] wrapping is enforced structurally via a go:generate gowrap decorator generated once per interface and regenerated on every interface change (see SR-003 FR-11); Rust’s #[tracing::instrument] is a compiler-visible attribute a reviewer can see is missing. Node’s equivalent is a plain function call a developer must remember to add by hand inside every new method body, with nothing that fails a build or a lint pass if it’s forgotten.
  • Impact: a new Node service/repository/controller method that omits runWithRequestContext silently breaks trace continuity for that one method — its logs and spans fall outside the request’s AsyncLocalStorage scope, so it won’t carry tenant_id/correlation_id/traceparent — with no automated signal (test failure, lint error, or build warning) that this happened.
  • Remediation direction: either a lint rule that flags an exported service/repository/controller method body not calling runWithRequestContext, or a TypeScript codegen/decorator approach once node-lang-core-lib gains the .d.ts coverage tracked separately in that library’s own known-gaps list. Out of scope to design fully here — flagged so a future Node-tracing task starts from this gap rather than rediscovering it.
  • Related requirement: SR-003 FR-10

TD-03 — No cloud/production monitoring integration exists; OTel is wired for local development only

  • Status: Open
  • Severity: Medium — no production incident possible yet since no production deployment exists, but this is a hard blocker the day a real cloud deployment target is scheduled; better tracked now than discovered under deadline pressure then.
  • Affected component: the platform’s entire observability pipeline (traces, logs, metrics) — currently 100% local-Docker-scoped, with no equivalent wiring for any cloud environment.
  • Evidence: a repo-wide search found zero Terraform files (*.tf) or a terraform/ directory anywhere in the monorepo (outside unrelated worktree sandboxes and one unrelated blog post about Kong/Terraform); zero references to GOOGLE_CLOUD_PROJECT, otlp.googleapis.com, GCP Cloud Monitoring/Cloud Trace, AWS CloudWatch, or Datadog in any service code or config; .claude/rules/07-deployment-and-local-infra.md (read in full) is entirely Docker-Compose-local-dev scoped, with no cloud deployment target of any kind documented. The local stack itself is real and complete — OTel Collector, Tempo, Prometheus, Loki, Vector, and Grafana are all defined and wired in development/docker-compose.yml and development/otel/ (see Architecture: Observability Pipeline’s “Local Development Architecture” section) — this gap is specifically about the absence of a cloud counterpart, not a gap in local tooling.
  • Impact: the moment this platform is deployed anywhere other than a developer’s local Docker stack, there is no monitoring, alerting, log search, or trace lookup available in that environment — an incident in a hypothetical staging/production deployment today would be debugged with no observability tooling at all.
  • Remediation direction: introduce infrastructure-as-code (Terraform is the natural choice given no other IaC tool is used anywhere in this repo) that provisions a cloud monitoring workspace (e.g. a GCP project’s Cloud Monitoring/Cloud Trace/Cloud Logging, or an equivalent on another provider) and configures the OTel Collector with an additional cloud exporter (e.g. googlecloud) alongside its existing local exporters — see Architecture: Observability Pipeline’s “Target Cloud Architecture” table for the component-by-component mapping. This is deliberately scoped as a future task, not designed in full here, since no cloud provider or deployment timeline has been decided.
  • Related requirement: SR-003 FR-21, BRD-003 BR-08

TD-04 — Central rules document “cadvisor”; the deployed container-metrics service is actually docker-exporter

  • Status: Open
  • Severity: Low — no functional impact (the deployed service performs the same role, container-level resource metrics via the Docker socket), but a documentation/reality drift that would mislead anyone searching development/docker-compose.yml for a service literally named cadvisor.
  • Affected component: .claude/rules/05-performance-and-metrics.md (“Container-level resource metrics” section) and at least one core-lib CLAUDE.md (go-lang-core-lib/CLAUDE.md) both describe this component as cadvisor.
  • Evidence: no service named cadvisor exists in development/docker-compose.yml. The actual service is docker-exporter (image ghcr.io/dlepaux/docker-exporter:latest, host port 8091:9713), mounting /var/run/docker.sock:ro — the same role, different tool.
  • Impact: low — purely a documentation-accuracy issue. This appDocs set (FR-15, and the Local Development Architecture table above) documents the real name, docker-exporter, rather than repeating the stale cadvisor reference.
  • Remediation direction: update .claude/rules/05-performance-and-metrics.md and any core-lib CLAUDE.md still saying cadvisor to say docker-exporter instead, in a small, standalone documentation-only change — out of scope for this appDocs doc set itself to edit central rules files.
  • Related requirement: SR-003 FR-15

TD-05 — Flutter’s client-side spans are created but never exported (no-op span processor)

  • Status: Open
  • Severity: Low — the request is still fully traceable from Nginx onward via the injected traceparent; only the client-side portion of the trace (time spent inside the mobile app itself, before/after the network call) is invisible.
  • Affected component: ui-application/src/lib/core/services/init/otel_tracing_service.dart’s OtelTracingService.init().
  • Evidence: OTel.initialize(...) is called with spanProcessor: _NoopSpanProcessor() — the class’s own code comment states plainly that no collector is wired up yet and spans are created but never exported anywhere. No mobile-reachable OTLP endpoint exists in the codebase to export to even if the processor were swapped.
  • Impact: a mobile-originated slowdown that happens entirely client-side (e.g. slow local processing before a request is even sent) leaves no trace evidence — only server-side spans starting at Nginx are visible in Tempo.
  • Remediation direction: replace _NoopSpanProcessor with a real BatchSpanProcessor exporting OTLP to a collector endpoint reachable from a mobile device (not localhost — needs a public/VPN-reachable ingress, which doesn’t exist for the local dev OTel Collector today; likely blocked on the same cloud-deployment gap as TD-03 above).
  • Related requirement: SR-003 NFR-10

TD-06 — React’s frontend logging has no structured format, unlike Flutter’s backend-matching log shape

  • Status: Open
  • Severity: Low — a readability/correlation gap, not a functional break; X-Correlation-ID/traceparent header injection (which is what actually ties a browser request to its backend logs) is unaffected.
  • Affected component: ui-admin-application’s frontend logging, built on the loglevel package.
  • Evidence: ui-admin-application/CLAUDE.md’s “Structured Frontend Logging with loglevel” section requires log.debug/warn/error calls with plain [Component] message-style prefixes (confirmed in apiClient.ts, main.tsx, TenantRepository.ts, and others) — no JSON fields, no trace_id/span_id/correlation_id embedded in the log line itself, unlike Flutter’s AppLog (see FR-23) or any backend core lib’s structured logger.
  • Impact: a React admin-panel log line cannot be visually or programmatically correlated to its matching backend/trace log the way a Flutter log line can — an engineer debugging from browser devtools console output has no trace_id/correlation_id printed alongside the message to cross-reference in Grafana.
  • Remediation direction: extend ui-admin-application’s logging wrapper to append the same trace_id/span_id/correlation_id fields Flutter’s AppLog does, sourced from the active OTel span context (already available via the @opentelemetry/api dependency already in package.json) — a moderate-sized, self-contained frontend change, not blocked on any other gap in this document.
  • Related requirement: SR-003 NFR-11