You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the v3 public_url configuration values introduced by #1417 in health-check responses, metrics, and runtime logs without conflating them with a service's configured bind address or its post-bind ServiceBinding.
Background
Each service has three distinct concepts:
Concept
Source
Meaning
Configured bind address
bind_address configuration
The requested local socket bind target. It may be wildcard (0.0.0.0 or [::]) and may use port 0.
Service binding
ServiceBinding created after the socket binds
The protocol plus the actual local socket address. An OS-assigned ephemeral port replaces configured port 0, but a wildcard address remains wildcard. It is an identity, not necessarily a reachable URL.
Public URL
Optional v3 public_url configuration
The operator-declared external endpoint. It may differ completely from the bind address and service binding because of reverse proxies, NAT, TLS termination, or DNS.
internal_service_url is a possible future concept. It is not implemented by this issue and cannot be inferred reliably from a wildcard service binding.
#1417 stores and validates typed v3 public_url values but deliberately does not consume them at runtime. #1980 migrates runtime consumers to explicit v3 configuration imports. This issue follows both changes.
Scope
In scope
Add an optional public-URL representation to health-check service details while preserving existing service_binding, binding, and service_type fields.
Add an optional public_url label to relevant per-service metrics when configured.
Add configured public_url, when present, to relevant service startup and request logs; retain service_binding as the local service identity.
Define and test absent-value behavior: services without public_url remain valid and do not claim a public endpoint.
Test that public_url, configured bind_address, and post-bind ServiceBinding remain distinguishable, including wildcard binding with an OS-assigned port.
Changing ServiceBinding or adding an internal_service_url type.
Choosing a concrete reachable interface for wildcard listeners.
Modifying the v2 configuration schema or supporting a v2 runtime fallback.
Changing BitTorrent protocol behavior or URL path routing.
Compatibility decisions
Surface
Required behavior
Health check
Add an optional public_url field. Retain service_binding, binding, and service_type unchanged.
Metrics
Add public_url only when configured. Confirm and document the resulting Prometheus-series/cardinality effect.
Logs
Emit service_binding as the local identity and optional public_url as the operator-declared endpoint. Neither replaces the other.
Acceptance criteria
A configured v3 public_url is exposed as an optional health-check field without replacing existing service-identity fields.
Relevant per-service metrics expose public_url only when configured.
Relevant startup and request logs identify the local service with service_binding and, independently, the configured public_url when present.
A wildcard bind address with configured port 0 demonstrates three separate values: configured bind address, post-bind service binding, and configured public URL.
Services without public_url preserve existing health-check, metric, and logging behavior.
No internal_service_url implementation or torrust-net-primitives change is made.
linter all and relevant tests pass.
Manual verification evidence records both configured and absent public_url cases.
Verification plan
Run linter all, focused tests for changed server, health-check, and metrics packages, and cargo test --workspace.
Start a local v3 tracker with bind_address = "0.0.0.0:0" and public_url = "https://tracker.example.test/announce"; verify health checks distinguish public URL from post-bind wildcard service binding.
Send an HTTP announce and query Prometheus metrics; verify configured public URL and existing server_binding_* labels are both present.
Repeat without public_url; verify existing fields remain and no public URL is claimed or labelled.
Risks and trade-offs
Public URLs can increase Prometheus time-series cardinality; restrict the label to configured per-service metric series and document the behavior.
Health-check additions must be optional and additive.
Logs and API fields must name service_binding and public_url explicitly so operators do not mistake either for an internal reachable URL.
Goal
Use the v3
public_urlconfiguration values introduced by #1417 in health-check responses, metrics, and runtime logs without conflating them with a service's configured bind address or its post-bindServiceBinding.Background
Each service has three distinct concepts:
bind_addressconfiguration0.0.0.0or[::]) and may use port0.ServiceBindingcreated after the socket binds0, but a wildcard address remains wildcard. It is an identity, not necessarily a reachable URL.public_urlconfigurationinternal_service_urlis a possible future concept. It is not implemented by this issue and cannot be inferred reliably from a wildcard service binding.#1417 stores and validates typed v3
public_urlvalues but deliberately does not consume them at runtime. #1980 migrates runtime consumers to explicit v3 configuration imports. This issue follows both changes.Scope
In scope
service_binding,binding, andservice_typefields.public_urllabel to relevant per-service metrics when configured.public_url, when present, to relevant service startup and request logs; retainservice_bindingas the local service identity.public_urlremain valid and do not claim a public endpoint.public_url, configuredbind_address, and post-bindServiceBindingremain distinguishable, including wildcard binding with an OS-assigned port.Out of scope
public_urlvalues.ServiceBindingor adding aninternal_service_urltype.Compatibility decisions
public_urlfield. Retainservice_binding,binding, andservice_typeunchanged.public_urlonly when configured. Confirm and document the resulting Prometheus-series/cardinality effect.service_bindingas the local identity and optionalpublic_urlas the operator-declared endpoint. Neither replaces the other.Acceptance criteria
public_urlis exposed as an optional health-check field without replacing existing service-identity fields.public_urlonly when configured.service_bindingand, independently, the configuredpublic_urlwhen present.0demonstrates three separate values: configured bind address, post-bind service binding, and configured public URL.public_urlpreserve existing health-check, metric, and logging behavior.internal_service_urlimplementation ortorrust-net-primitiveschange is made.linter alland relevant tests pass.public_urlcases.Verification plan
linter all, focused tests for changed server, health-check, and metrics packages, andcargo test --workspace.bind_address = "0.0.0.0:0"andpublic_url = "https://tracker.example.test/announce"; verify health checks distinguish public URL from post-bind wildcard service binding.server_binding_*labels are both present.public_url; verify existing fields remain and no public URL is claimed or labelled.Risks and trade-offs
service_bindingandpublic_urlexplicitly so operators do not mistake either for an internal reachable URL.References