Skip to content

impl(o11y): introduce url.full#12192

Draft
diegomarquezp wants to merge 2 commits intogoogleapis:mainfrom
diegomarquezp:observability/tracing-attr/url.full
Draft

impl(o11y): introduce url.full#12192
diegomarquezp wants to merge 2 commits intogoogleapis:mainfrom
diegomarquezp:observability/tracing-attr/url.full

Conversation

@diegomarquezp
Copy link
Contributor

  • Adds HTTP_URL_FULL_ATTRIBUTE to ObservabilityAttributes
  • Introduces requestUrlResolved into ApiTracer
  • Implements redaction logic in ObservabilityUtils
  • Passes tracer into HTTP/JSON transport to record the URL

Note: Following Footnote 3, the spec indicates logging implementations MAY expose a configuration to override redacted fields. This implementation does not expose this configurability to provide a consistent and optimally safe baseline out of the box.

- Adds HTTP_URL_FULL_ATTRIBUTE to ObservabilityAttributes
- Introduces requestUrlResolved into ApiTracer
- Implements redaction logic in ObservabilityUtils
- Passes tracer into HTTP/JSON transport to record the URL
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the observability of HTTP requests by enabling the capture of the full HTTP URL in traces. It introduces a new attribute for URLs, extends the tracing API to record these URLs, and critically, implements a comprehensive sanitization mechanism to automatically redact sensitive information from URLs, such as user credentials and specific query parameters. This ensures that detailed request context is available for debugging and analysis without compromising security or privacy.

Highlights

  • New Observability Attribute: Introduced "HTTP_URL_FULL_ATTRIBUTE" to capture the full HTTP URL in traces, enhancing debugging and monitoring capabilities.
  • API Tracer Enhancement: Added "requestUrlResolved" method to "ApiTracer" to allow tracing implementations to record the resolved HTTP URL.
  • Sensitive Data Redaction: Implemented robust URL sanitization logic in "ObservabilityUtils" to redact sensitive information (like credentials and specific query parameters) from URLs before they are recorded in traces, adhering to OpenTelemetry semantic conventions.
  • Integration with HTTP/JSON Transport: Integrated the "ApiTracer" into the HTTP/JSON transport layer to ensure that the full, sanitized URL is captured and passed to the tracing system.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 introduces HTTP URL tracing capabilities to GAX, allowing the ApiTracer to record the full resolved HTTP URL for requests. This involves adding an ApiTracer field to HttpJsonCallOptions, updating call creation logic to pass the tracer, and invoking tracer.requestUrlResolved with the built URL. A significant part of this change is the addition of ObservabilityUtils.sanitizeUrlFull and redactSensitiveQueryValues methods, which redact sensitive information (like user credentials and specific query parameters) from URLs before they are recorded, aligning with OpenTelemetry semantic conventions. Corresponding unit tests have been added for the new URL sanitization logic and SpanTracer integration. Review feedback suggests minor readability improvements in ObservabilityUtils.java by importing specific classes and refining exception handling.

@diegomarquezp diegomarquezp changed the title feat: capture HTTP full URL in traces impl(o11y): introduce url.full Mar 24, 2026
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.

1 participant