Migrate from Trillium [part 8]: remove Trillium server, serve Axum directly#2249
Closed
Migrate from Trillium [part 8]: remove Trillium server, serve Axum directly#2249
Conversation
…rectly Axum is now the primary HTTP listener. The Trillium server, which was a pure pass-through proxy since Part 7C, is removed from the request path. Production changes: - `build_app(Config) -> BuiltApp` replaces `DivviupApi` for production use - `bin.rs` rewritten: Axum serves directly, monitoring server is a separate Axum router, graceful shutdown via tokio signals + CancellationToken - `Queue` uses `CancellationToken` instead of Trillium's `Stopper`/`CloneCounterObserver` - `telemetry.rs` and `trace.rs` handlers converted from Trillium to Axum - `Config` gains `listen_address` field (from HOST/PORT env vars, default [::]:8080) Dead code removal: - Deleted: `handler/logger.rs`, `handler/opentelemetry.rs`, `axum_proxy` test - Removed `FromConn` impls from: `Db`, `User`, `PermissionsActor`, `AccountBearerToken` - Removed Trillium `Handler` impls from: `Db`, `ErrorHandler`, `CorsHeaders`, `ReplaceMimeTypes`, `SessionStore` - Unified `PermissionsActor::is_allowed`/`if_allowed` to use `http::Method` - Removed deps: `trillium-compression`, `trillium-conn-id`, `trillium-forwarding`, `trillium-opentelemetry`, `trillium-prometheus`, `trillium-redirect`, `trillium-sessions`, `trillium-cookies`, `async-session` - Added deps: `cookie` (key-expansion feature, for session key derivation) `DivviupApi` is kept as a thin test-only shim that spawns Axum on [::1]:0 and proxies via the existing `AxumProxy`, preserving test-support compatibility. Full test-support rewrite is deferred to Part 9.
jcjones
commented
May 8, 2026
|
|
||
| // TODO(Part 9): add OpenTelemetry HTTP metrics middleware. The deleted | ||
| // trillium-opentelemetry handler provided http.server.* histograms and | ||
| // optional OTLP per-request spans; TraceLayer only emits tracing events. |
Contributor
Author
There was a problem hiding this comment.
note here that the http.server.* histograms are currently missing, but the application-level metrics using global::meter are emitted. Fixing in Part 9.
Contributor
Author
|
Splitting this out from the assets change is proving to be more headache than it's worth. |
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.
Axum is now the primary HTTP listener. The Trillium server, which was a pure pass-through proxy since Part 7C, is removed from the request path.
Production changes:
build_app(Config) -> BuiltAppreplacesDivviupApifor production usebin.rsrewritten: Axum serves directly, monitoring server is a separate Axum router, graceful shutdown via tokio signals + CancellationTokenQueueusesCancellationTokeninstead of Trillium'sStopper/CloneCounterObservertelemetry.rsandtrace.rshandlers converted from Trillium to AxumConfiggainslisten_addressfield (from HOST/PORT env vars, default [::]:8080)Dead code removal:
handler/logger.rs,handler/opentelemetry.rs,axum_proxytestFromConnimpls from:Db,User,PermissionsActor,AccountBearerTokenHandlerimpls from:Db,ErrorHandler,CorsHeaders,ReplaceMimeTypes,SessionStorePermissionsActor::is_allowed/if_allowedto usehttp::Methodtrillium-compression,trillium-conn-id,trillium-forwarding,trillium-opentelemetry,trillium-prometheus,trillium-redirect,trillium-sessions,trillium-cookies,async-sessioncookie(key-expansion feature, for session key derivation)DivviupApiis kept as a thin test-only shim that spawns Axum on IPv6 Localhost and proxies via the existingAxumProxy, preserving test-support compatibility. Full test-support rewrite is deferred to Part 9.