feat(auth): enrich invoke-level telemetry with transport detail#14264
feat(auth): enrich invoke-level telemetry with transport detail#14264westarle merged 4 commits intogoogleapis:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request enhances OpenTelemetry integration by adding metrics support for both gRPC and HTTP transports. For gRPC, a new unary client interceptor is introduced to extract server address and port from the target and populate gax.TransportTelemetryData, utilizing a new extractHostPort helper function. For HTTP, the otelAttributeTransport is updated to similarly extract server address, port, and response status code. New unit tests cover these telemetry functionalities and the extractHostPort helper. Review feedback indicates an improvement opportunity in extractHostPort's error handling when the port is invalid, suggesting it should return the parsed host instead of the full target string, along with a corresponding test case update.
cf67087 to
643756c
Compare
099729a to
03340f3
Compare
03340f3 to
ce631e8
Compare
- Avoid expensive net.SplitHostPort per-RPC in gRPC interceptor - Extract HTTP host and port directly from req.URL instead of physical connection - Add scheme-based fallback for implicit HTTP ports - Add implicit port extraction tests
This PR has auth code fill in TelemetryTransportData in order to send details from the transport back up to higher layers. See googleapis/gax-go#496. This in turn allows code in those higher layers to report telemetry information for the last request that is only known by the transport layer.
Changes Made
req.URL(HTTP) andcc.Target()(gRPC) prior to invoking the transportlayer.
80for HTTP,443for HTTPS) when handling URLs with implicit ports.