impl(o11y): introduce url.full#12192
Conversation
- 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
Summary of ChangesHello, 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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/tracing/ObservabilityUtils.java
Outdated
Show resolved
Hide resolved
sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/tracing/ObservabilityUtils.java
Show resolved
Hide resolved
url.full
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.