Repository navigation
Closed
Labels
Description
Goal
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, andservice_typefields. - Add an optional
public_urllabel to relevant per-service metrics when configured. - Add configured
public_url, when present, to relevant service startup and request logs; retainservice_bindingas the local service identity. - Define and test absent-value behavior: services without
public_urlremain valid and do not claim a public endpoint. - Test that
public_url, configuredbind_address, and post-bindServiceBindingremain distinguishable, including wildcard binding with an OS-assigned port.
Out of scope
- Changing how Include public service URL in configuration #1417 validates or stores v3
public_urlvalues. - Changing
ServiceBindingor adding aninternal_service_urltype. - 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_urlis exposed as an optional health-check field without replacing existing service-identity fields. - Relevant per-service metrics expose
public_urlonly when configured. - Relevant startup and request logs identify the local service with
service_bindingand, independently, the configuredpublic_urlwhen present. - A wildcard bind address with configured port
0demonstrates three separate values: configured bind address, post-bind service binding, and configured public URL. - Services without
public_urlpreserve existing health-check, metric, and logging behavior. - No
internal_service_urlimplementation ortorrust-net-primitiveschange is made. -
linter alland relevant tests pass. - Manual verification evidence records both configured and absent
public_urlcases.
Verification plan
- Run
linter all, focused tests for changed server, health-check, and metrics packages, andcargo test --workspace. - Start a local v3 tracker with
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. - 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_bindingandpublic_urlexplicitly so operators do not mistake either for an internal reachable URL.
References
- Include public service URL in configuration #1417 — typed v3 public URL configuration
- Make server listen URL available where server socket address is also available #1415 — service binding identity
- Configuration overhaul final cleanup: remove global re-exports, migrate consumers to explicit versioned imports #1980 — explicit v3 consumer migration
- EPIC Overhaul: Configuration (schema v3.0.0) #1978 — configuration overhaul
Activity
docs(configuration): convert epic to folder type and add migration guide
Merge #2068: docs(issues): add #2067 analysis specification