Repository navigation
fix(google-api-core): align OpenTelemetry span names, kinds, and T3 endpoint attributes with spec - #18866
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates OpenTelemetry tracing in google-api-core by changing the span kind of API method wrappers from CLIENT to INTERNAL and incorporating endpoint attributes (such as url.domain, server.address, and server.port) from client_options into these spans. Additionally, HTTP span names are updated to include the URL template (e.g., "POST /v1/echo"). Tests and the telemetry requirements matrix have been updated accordingly. There are no review comments, and I have no feedback to provide.
daniel-sanche
approved these changes
Oct 27, 2026
chalmerlowe
force-pushed
the
test/centralize-monorepo-core-sync-check
branch
from
October 27, 2026 20:34
dbb6d01 to
1f69e89
Compare
Base automatically changed from
test/centralize-monorepo-core-sync-check
to
main
October 27, 2026 22:06
chalmerlowe
force-pushed
the
fix/otel-test-plan-alignment-2
branch
from
October 27, 2026 23:02
c32dfd6 to
628ecb8
Compare
Closed
chalmerlowe
force-pushed
the
fix/otel-test-plan-alignment-2
branch
from
October 28, 2026 09:00
628ecb8 to
d292a3a
Compare
chalmerlowe
changed the base branch from
main
to
test/ignore-pytest-asyncio-loop-scope-warning
October 28, 2026 09:01
…ndpoint attributes with spec
chalmerlowe
changed the base branch from
test/ignore-pytest-asyncio-loop-scope-warning
to
main
October 28, 2026 21:03
chalmerlowe
force-pushed
the
fix/otel-test-plan-alignment-2
branch
from
October 28, 2026 21:03
d292a3a to
c014818
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Several OpenTelemetry span fields did not match the Cloud SDK tracing specification:
POST) instead of combining the verb and the URL template.CLIENTinstead ofINTERNAL. Tier 3 spans track the overall SDK method call, while Tier 4 spans track the outbound network attempts (CLIENT).url.domain(orserver.addressandserver.portwhen configured inClientOptions).Solution
_observability.py: Updated_build_http_span_attributesto format the span name as{method} {url_template}(for example,POST /v1beta1/echo:echo).{method}whenurl_templateis not provided.method.py: Updated_GapicCallable.__init__to:SpanKind.INTERNAL._extract_endpoint_attributes(client_options)into the Tier 3 span attributes sourl.domainis always recorded.test_observability.py,test_method.py,test_method_async.py,conftest.py: Updated unit test expectations for the new span names, span kind, andurl.domainattribute.telemetry_requirements_matrix.csv: Updated system test expectations to match.Notes for Reviewers
server.addressandserver.portfrom default transport hosts (whenclient_options.api_endpointis not set by the caller) will be handled in a follow-up PR.