Skip to content

docs: Unknown routes are now recorded in HTTP metrics (path="other"), access logs, and request IDs - #72

Closed
github-actions[bot] wants to merge 2 commits into
mainfrom
codex/nightly-docs-326a1a4ee3b5ad89
Closed

github-actions[bot] wants to merge 2 commits into
mainfrom
codex/nightly-docs-326a1a4ee3b5ad89

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Are requests to unknown paths visible in SMG's HTTP metrics, access logs, and request-ID correlation, and under what path label?

Why we need it

Source change: smg-project/smg@0a58a6c

Commit 0a58a6c (#2679, landed after the v1.11.0 version bump) added attach_edge_layers in model_gateway/src/server.rs: the sink_handler 404 fallback is now registered before the body-limit, logging (middleware::create_logging_layer), HTTP-metrics (HttpMetricsLayer), RequestIdLayer, and CORS layers, with the test unknown_routes_cross_the_edge_middleware asserting an unknown route gets x-request-id. In current source, model_gateway/src/middleware/metrics.rs matched_path_label maps requests with no MatchedPath to "other" (test unmatched_path_collapses_to_other), and model_gateway/src/middleware/logging.rs RequestLogger/ResponseLogger record smg_http_requests_total and log started/finished lines inside the http_request span for every request crossing the layer. Three current docs claims are now wrong: src/lib/content/reference/metrics.md line 51 says requests that match no route "get a bare 404 from a fallback outside the metrics layer and are not recorded"; src/lib/content/getting-started/logging.md line 142 says "A request to an unknown path gets a bare 404 and is not logged" (and lines 132/465 scope the http_request span and request IDs to requests "that match a route"); src/lib/content/getting-started/monitoring.md line 76 says the http_request span is exported "for each HTTP request that matches a route". This is one independent concern: a single fallback relocation makes unknown routes observable across metrics, logs, and request IDs. The fix is on main only (post-v1.11.0), so the edit should describe main and may note that v1.11.0 and earlier skipped these requests.

Scope: observability / unknown-route-edge-middleware. Other concerns are deferred.

How to test

  • Passed the documentation path and size guard (under 1000 added plus deleted lines; no file-count limit).
  • Passed an independent accuracy and single-concern review.
  • Passed git diff --check and pnpm check and the production pnpm build.

Source-level follow-up validation

The outer CORS layer handles OPTIONS directly; those requests bypass the inner logging, metrics, and request-ID layers. The documentation explicitly retains this exception. The corrected diff passed git diff --check, pnpm check, and pnpm build.

Checklist

  • Tests added/updated (if applicable)
  • Docs updated (if applicable)
  • Commit signed off by XinyueZhang369 zoeyzhang369@gmail.com

Signed-off-by: XinyueZhang369 <zoeyzhang369@gmail.com>
@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0a689dcc-0cd3-4f12-8b26-9dfe76d4d7bc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: XinyueZhang369 <zoeyzhang369@gmail.com>
@XinyueZhang369 XinyueZhang369 changed the title [Docs] Unknown routes are now recorded in HTTP metrics (path="other"), access logs, and request IDs docs: Unknown routes are now recorded in HTTP metrics (path="other"), access logs, and request IDs Sep 27, 2026
@slin1237 slin1237 closed this Sep 30, 2026
@lightseek-bot
lightseek-bot deleted the codex/nightly-docs-326a1a4ee3b5ad89 branch October 6, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants