Skip to content

Add protocol-aware service bindings to server logs - #2025

Merged
josecelano merged 5 commits into
torrust:developfrom
josecelano:1415-use-service-binding
Jul 22, 2026
Merged

Add protocol-aware service bindings to server logs#2025
josecelano merged 5 commits into
torrust:developfrom
josecelano:1415-use-service-binding

Conversation

@josecelano

Copy link
Copy Markdown
Member

Summary

Add protocol-aware service_binding fields to server operational logs while retaining the existing server_socket_addr field for compatibility.

  • HTTP tracker and REST API request/response logs now include the post-bind ServiceBinding.
  • UDP error logs now include the post-bind ServiceBinding.
  • The REST API router now receives ServiceBinding and derives the compatible socket-address field from it.
  • Record manual runtime evidence and clarify that both fields describe the same actual bound address, including an OS-assigned port.

Verification

  • cargo fmt --check
  • linter all
  • cargo test -p torrust-tracker-axum-http-server -p torrust-tracker-axum-rest-api-server -p torrust-tracker-udp-server
  • cargo test --workspace
  • TORRUST_GIT_HOOKS_LOG_DIR=.tmp ./contrib/dev-tools/git/hooks/pre-commit.sh

Closes #1415

Copilot AI review requested due to automatic review settings July 22, 2026 16:23
@josecelano josecelano self-assigned this Jul 22, 2026

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

This PR implements issue #1415 by making operational server logs protocol-aware via ServiceBinding, while preserving the existing server_socket_addr field for compatibility. This aligns runtime logging with the already protocol-aware service identity used elsewhere (e.g., health check details and metric labels).

Changes:

  • Add service_binding (post-bind ServiceBinding) to HTTP tracker + REST API request/response tracing logs, retaining server_socket_addr.
  • Add service_binding to UDP error logs, retaining server_socket_addr.
  • Update REST API router wiring to accept &ServiceBinding and derive server_socket_addr from it; add manual verification evidence to the issue spec.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/udp-server/src/handlers/error.rs Include service_binding in UDP error logs while keeping server_socket_addr.
packages/axum-rest-api-server/src/server.rs Build ServiceBinding post-bind and pass it into the router.
packages/axum-rest-api-server/src/routes.rs Add service_binding + derived server_socket_addr to request/response/failure logs.
packages/axum-http-server/src/v1/routes.rs Add service_binding + derived server_socket_addr to request/response/failure logs (refactored via helper).
docs/issues/open/2023-1978-expose-configured-public-urls-in-runtime-observability.md New follow-up issue spec clarifying separation of bind address vs service binding vs public URL.
docs/issues/open/1978-configuration-overhaul-epic.md Update EPIC tracking to reflect #1415 completion and add #2023 follow-up.
docs/issues/open/1415-1978-use-service-binding-instead-of-socket-addr/manual-verification.md Add recorded manual verification evidence for the new log fields and unchanged health/metrics behavior.
docs/issues/open/1415-1978-use-service-binding-instead-of-socket-addr/ISSUE.md Add finalized issue spec (folder form) documenting goals, constraints, and verification.
docs/issues/open/1415-1978-use-service-binding-instead-of-socket-addr.md Remove the old single-file spec in favor of the folder-based spec + evidence files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings July 22, 2026 16:50

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 10 out of 10 changed files in this pull request and generated no new comments.

@josecelano

Copy link
Copy Markdown
Member Author

ACK 58504af

@josecelano
josecelano merged commit 81a1e3e into torrust:develop Jul 22, 2026
16 checks passed
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.

Make server listen URL available where server socket address is also available

2 participants