Repository navigation
feat(observability): expose configured public URLs - #2124
Merged
josecelano merged 8 commits intoSep 1, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR exposes the configured v3 public_url for each listener as runtime observability data (health-check details, per-service metrics labels, and startup logs) while keeping it distinct from the post-bind ServiceBinding.
Changes:
- Extend
RuntimeServiceMetadatato carry an optional, validatedurl::Urlpublic_url, and thread it into HTTP/UDP/rest-api listener startup paths. - Add nullable
public_urlto health-check service details and includepublic_urlas an optional Prometheus label only when configured. - Add/refresh issue #2023 folder-style documentation plus automated/manual verification evidence.
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app.rs | Pass configured public_url into listener runtime metadata for UDP/HTTP/REST API startup. |
| packages/udp-server/src/server/states.rs | Emit public_url in UDP startup logs only when configured. |
| packages/udp-server/src/handlers/scrape.rs | Attach public_url to UDP scrape event connection context. |
| packages/udp-server/src/handlers/mod.rs | Plumb optional public_url into UDP error handling path. |
| packages/udp-server/src/handlers/error.rs | Include public_url in UDP error events/contexts. |
| packages/udp-server/src/handlers/connect.rs | Attach public_url to UDP connect event connection context. |
| packages/udp-server/src/handlers/announce.rs | Attach public_url to UDP announce event connection context. |
| packages/udp-core/src/services/scrape.rs | Store/propagate public_url through UDP scrape service + metrics event context. |
| packages/udp-core/src/services/connect.rs | Store/propagate public_url through UDP connect service + metrics event context. |
| packages/udp-core/src/services/announce.rs | Store/propagate public_url through UDP announce service + metrics event context. |
| packages/udp-core/src/event.rs | Add optional public_url to UDP connection context and metric label set. |
| packages/udp-core/src/container.rs | Inject configured public_url into UDP core services. |
| packages/primitives/src/runtime_service_metadata.rs | Add typed public_url: Option<Url> to runtime listener metadata. |
| packages/primitives/Cargo.toml | Add url dependency needed by runtime metadata. |
| packages/http-core/src/services/scrape.rs | Store/propagate public_url through HTTP scrape service + metrics event context. |
| packages/http-core/src/services/announce.rs | Store/propagate public_url through HTTP announce service + metrics event context. |
| packages/http-core/src/event.rs | Add optional public_url to HTTP connection context and metric label set. |
| packages/axum-rest-api-server/src/testing/environment.rs | Provide public_url metadata in REST API test environment startup. |
| packages/axum-rest-api-server/src/server.rs | Emit public_url in REST API startup logs only when configured. |
| packages/axum-http-server/src/server.rs | Emit public_url in HTTP tracker startup logs only when configured. |
| packages/axum-health-check-api-server/tests/server/contract.rs | Extend contract tests to assert public_url presence/absence and port-0 wildcard separation. |
| packages/axum-health-check-api-server/src/resources.rs | Add nullable public_url to health-check CheckReport. |
| packages/axum-health-check-api-server/src/handlers.rs | Populate health-check public_url from service runtime metadata. |
| docs/issues/open/2023-1978-expose-configured-public-urls-in-runtime-observability/manual-verification.md | Add reproducible manual runtime evidence for configured/absent public_url. |
| docs/issues/open/2023-1978-expose-configured-public-urls-in-runtime-observability/ISSUE.md | Migrate issue #2023 to folder-style spec and mark tasks/ACs as completed. |
| docs/issues/open/2023-1978-expose-configured-public-urls-in-runtime-observability/automated-verification.md | Record automated verification command evidence. |
| docs/issues/open/1978-configuration-overhaul-epic/EPIC.md | Update epic subissue link to the folder-style issue spec. |
| docs/issues/closed/1415-1978-use-service-binding-instead-of-socket-addr/ISSUE.md | Update #1415 references to point to the new #2023 folder path. |
| Cargo.lock | Lockfile update for the added url dependency. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2124 +/- ##
===========================================
+ Coverage 83.99% 84.04% +0.05%
===========================================
Files 349 349
Lines 27240 27376 +136
Branches 27240 27376 +136
===========================================
+ Hits 22879 23008 +129
- Misses 4018 4022 +4
- Partials 343 346 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
josecelano
force-pushed
the
2023-expose-configured-public-urls
branch
from
September 1, 2026 09:08
ce03da3 to
5cd1687
Compare
Member
Author
|
ACK 5cd1687 |
This branch was previously deployed
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.
Summary
Expose each configured v3
public_urlas listener-specific runtime observability data without conflating it with the post-bind localServiceBinding.public_urlto health-check service details;public_urlmetric labels only for configured services and metric families that already carry service-binding labels;public_urlin startup logs only when it is configured, retainingservice_bindingin every event;url::Urlvalues inRuntimeServiceMetadataand render strings only at JSON/log boundaries;Runtime output
For an HTTP tracker configured with
bind_address = "0.0.0.0:0"and:the OS chooses the local port while the configured external endpoint remains independent:
The health-check response preserves both identities rather than replacing the local binding:
{ "service_binding": "http://0.0.0.0:36535/", "binding": "0.0.0.0:36535", "service_type": "http_tracker", "public_url": "https://tracker.example.test/announce" }After an HTTP announce, the corresponding metric sample includes the configured public URL alongside its existing local-binding labels:
When
public_urlis omitted, the health-check response contains"public_url": null; startup logs omit thepublic_urlfield and metrics omit thepublic_urllabel. This avoids exposing RustOptionformatting such asSome(...)orNonein operator-facing logs.Complete configured and absent runtime captures, commands, and effective configurations are recorded in
docs/issues/open/2023-1978-expose-configured-public-urls-in-runtime-observability/manual-verification.md.Verification
cargo test --workspacelinter all./contrib/dev-tools/git/hooks/pre-commit.shCloses #2023