googleapis / googleapis/google-cloud-rust

ClientSnapshot::server_port() returns 443 for http:// URLs without port

Open Beginner friendly
#6,709 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Rust
Stars
955
Forks
144
Avg merge
1d 5h
Merged PRs (30d)
279

Description

Unconfirmed. This is the result of a search with Claude, may be a false positive.

In `src/gax-internal/src/observability/client_signals/recorder.rs`, `server_port()` resolves the server port attribute:

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/gax-internal/src/observability/client_signals/recorder.rs#L375-L382

If the endpoint URI does not include an explicit port, it falls back unconditionally to `HTTPS_PORT` (`443`). For plain HTTP endpoints (e.g. local emulators or HTTP proxies with scheme `http://`), the port is reported as 443 instead of 80.

Contributor guide

Open the contributing guide

Research direction

Start in src/gax-internal/src/observability/client_signals/recorder.rs at ClientSnapshot::server_port(), focusing on how the endpoint URI scheme is handled when no port is explicit. Verify the reported value for HTTP and HTTPS endpoints, then add or update coverage for the HTTP case and run the relevant Rust tests. Done means HTTP defaults to 80 while HTTPS retains 443.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
observability-sre
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.