Observability

The system is built for deep visibility, using structured logging, distributed tracing, and real-time metrics.

Distributed Tracing

Every request is instrumented with OpenTelemetry. When a request enters the ApiReverseProxy, a trace is started (or continued if headers exist).

  • Context Propagation: Support for W3C Trace Context headers (traceparent).
  • Custom Spans: Spans are created for Route Resolution, Auth validation, and Upstream request timing.
  • Exporters: Standard OTLP exporter support (connects to Jaeger, Honeycomb, or AWS X-Ray).

Structured Logging

We use Serilog for machine-readable logging. Logs are not just strings but data structures that include:

{
  "Timestamp": "2024-03-20T10:00:00Z",
  "Level": "Information",
  "MessageTemplate": "Route resolved: {Tenant}/{Catalog}{Path} -> {UpstreamUrl}",
  "Properties": {
    "Tenant": "acme-corp",
    "Catalog": "crm-api",
    "Environment": "production",
    "CorrelationId": "4f9a-8b2c",
    "AppId": "internal-dashboard"
  }
}

Real-time Metrics

The Gateway exposes standard Prometheus-compatible metrics on the /metrics endpoint.

Throughput

http_requests_total broken down by status code and catalog.

Latency

http_request_duration_seconds histograms for upstream response times.

Errors

Counter for 4xx and 5xx responses per tenant.

Saturation

Active connection counts and thread pool usage.

Correlation Across Tiers

The Correlation-ID is injected into every response header. If you encounter a bug, provide the correlation ID from your browser or app, and our logs will show the exact path that request took through the management system and proxy.