Skip to content

feat(observability): implement url.domain attribute#12316

Open
diegomarquezp wants to merge 5 commits intomainfrom
observability/tracing-attr/url.domain
Open

feat(observability): implement url.domain attribute#12316
diegomarquezp wants to merge 5 commits intomainfrom
observability/tracing-attr/url.domain

Conversation

@diegomarquezp
Copy link
Copy Markdown
Contributor

This Pull Request implements the url.domain observability attribute in the gax-java library. This attribute records the 'nominal' domain where the request is intended to go (e.g., service.googleapis.com), distinct from server.address which reflects the actual destination (which could be localhost or a proxy).

The attribute is now recorded in both attempt-level spans and metrics for both gRPC and HTTP/JSON transports, provided that the serviceName is available in the ClientContext.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables the urlDomain attribute for observability across all transport types by updating ClientContext to derive it from the service name and universe domain. It also modifies ApiTracerContext to include this attribute in both attempt and metrics attributes and adds relevant unit and integration tests. A review comment identifies a potential issue where a null universe domain could result in a malformed string like "serviceName.null", suggesting a check for both values before concatenation.

@diegomarquezp diegomarquezp marked this pull request as ready for review March 30, 2026 21:29
@diegomarquezp diegomarquezp requested a review from a team as a code owner March 30, 2026 21:29
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.

2 participants