Skip to content

add: support to bridge telemetry gap - #28

Merged
Travis Sharp (tsharp) merged 7 commits into
microsoft:mainfrom
tsharp:fix/telemetry-gap
Aug 18, 2026
Merged

add: support to bridge telemetry gap#28
Travis Sharp (tsharp) merged 7 commits into
microsoft:mainfrom
tsharp:fix/telemetry-gap

Conversation

@tsharp

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI balanced review requested due to automatic review settings August 18, 2026 18:26
@tsharp
Travis Sharp (tsharp) requested a review from a team as a code owner August 18, 2026 18:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds request-scoped TCP delivery callbacks so applications can observe response delivery outcomes.

Changes:

  • Introduces delivery outcome, phase, abort-reason, and callback APIs.
  • Tracks encoding, writing, flushing, and failure outcomes.
  • Adds coverage for successful, failed, and cancelled delivery.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
nacelle-core/src/pipeline.rs Adds completion-token transformation.
nacelle-tcp/src/protocol.rs Defines the public completion API.
nacelle-tcp/src/lib.rs Re-exports new API types.
nacelle-tcp/src/connection/request.rs Settles callbacks during request processing.
nacelle-tcp/src/connection/response.rs Tracks delivery phases and byte counts.
nacelle-tcp/src/connection/tests.rs Tests completion outcomes and ordering.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread nacelle-tcp/src/connection/request.rs
Comment thread nacelle-tcp/src/protocol.rs
Comment thread nacelle-tcp/src/connection/request.rs
Comment thread nacelle-tcp/src/protocol.rs
Comment thread nacelle-tcp/src/protocol.rs
Comment thread nacelle-tcp/src/connection/request.rs
Comment thread nacelle-tcp/src/connection/request.rs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.

Suppressed comments (5)

nacelle-http/src/server.rs:1372

  • The worker-local Rustls path has the same lifecycle gap: it emits ConnectionOpened before the handshake, while handshake errors/timeouts return at lines 490-499 without reaching this call. Move close settlement around the complete spawned task so every accepted/opened TLS connection receives a terminal event.
    server.runtime.telemetry.connection_closed(
        NacelleTransport::new("http"),
        None,
        http_close_reason(&result),
    );

nacelle-core/src/telemetry/mod.rs:534

  • When context is None, this skips the metric entirely. Both new HTTP call sites always pass None, so HTTP emits server.connection.opened but never increments the documented server.connection.closed counter even though transport and close reason are available. Emit a transport-labeled fallback counter for context-free transports.
        if let Some(context) = context
            && self.connection_metrics_enabled()
        {

nacelle-http/src/server.rs:1310

  • This close event only runs after run_http_connection is entered, but the shared Rustls listener records ConnectionOpened before the handshake and returns directly on handshake error or timeout at lines 920-928. Those failed accepted connections therefore leave an unmatched open event. Settle the close event around the whole spawned connection task, including TLS handshake failure, rather than only around Hyper serving.

This issue also appears on line 1368 of the same file.

    server.runtime.telemetry.connection_closed(
        NacelleTransport::new("http"),
        None,
        http_close_reason(&result),
    );

nacelle-http/src/policy.rs:253

  • Only the request-side IPv6 literal is canonicalized. with_allowed_hosts still stores configured values using lowercase/trailing-dot normalization only, so an entry such as [0:0:0:0:0:0:0:1] (or the same form with a port) never matches even an identical incoming Host value because this line turns the request into [::1]. Parse and canonicalize allowlist authorities at configuration time with the same normalization used here.
        return Some(NormalizedHost {
            host: format!("[{addr}]"),
            port,

nacelle-http/src/server.rs:1380

  • Ok(()) does not imply socket EOF for Hyper: a valid HTTP/1 request with Connection: close completes this future normally without the peer first closing its write side (the new test exercises exactly that path). Labeling every normal protocol completion as eof makes close-reason telemetry inaccurate; use a neutral reason such as completed/normal unless an actual EOF can be observed.
        Ok(()) => "eof",

Comment thread nacelle-core/src/telemetry/mod.rs
@tsharp
Travis Sharp (tsharp) merged commit acb9d62 into microsoft:main Aug 18, 2026
17 checks passed
@tsharp
Travis Sharp (tsharp) deleted the fix/telemetry-gap branch August 18, 2026 22:22
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