add: support to bridge telemetry gap - #28
Merged
Merged
Conversation
There was a problem hiding this comment.
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.
Travis Sharp (tsharp)
force-pushed
the
main
branch
from
August 18, 2026 21:27
1198653 to
5188088
Compare
There was a problem hiding this comment.
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
ConnectionOpenedbefore 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
contextisNone, this skips the metric entirely. Both new HTTP call sites always passNone, so HTTP emitsserver.connection.openedbut never increments the documentedserver.connection.closedcounter 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_connectionis entered, but the shared Rustls listener recordsConnectionOpenedbefore 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_hostsstill 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 withConnection: closecompletes this future normally without the peer first closing its write side (the new test exercises exactly that path). Labeling every normal protocol completion aseofmakes close-reason telemetry inaccurate; use a neutral reason such ascompleted/normalunless an actual EOF can be observed.
Ok(()) => "eof",
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.