-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(transport): add OpenTelemetry context propagation #2127
Merged
Conversation
This file contains 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
As most of the ecosystem has moved on to opentelemetry, it'd be interesting to hear how otel support here is going to evolve (and what the deprecation path of the opencensus instrumentation looks like). Any input there? |
quartzmo
force-pushed
the
transport-open-telemetry
branch
from
November 7, 2023 16:34
29124f7
to
f491ead
Compare
quartzmo
force-pushed
the
transport-open-telemetry
branch
from
November 13, 2023 23:53
6d1aaf9
to
7b91188
Compare
quartzmo
force-pushed
the
transport-open-telemetry
branch
from
November 17, 2023 21:48
7b91188
to
35c3d65
Compare
quartzmo
force-pushed
the
transport-open-telemetry
branch
from
November 17, 2023 23:04
35c3d65
to
41c4009
Compare
quartzmo
added a commit
to quartzmo/google-cloud-go
that referenced
this pull request
Dec 4, 2023
codyoss
approved these changes
Dec 5, 2023
shollyman
approved these changes
Dec 5, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, modulo a bit of feedback on the dialcontext testing.
quartzmo
added a commit
to googleapis/google-cloud-go
that referenced
this pull request
Jan 11, 2024
quartzmo
added a commit
to quartzmo/google-cloud-go
that referenced
this pull request
Oct 8, 2024
quartzmo
added a commit
to quartzmo/google-cloud-go
that referenced
this pull request
Oct 8, 2024
quartzmo
added a commit
to googleapis/google-cloud-go
that referenced
this pull request
Oct 9, 2024
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.
OpenCensus sunsetting and OpenTelemetry support
The OpenCensus project is obsolete and was archived on July 31st, 2023. This means that any security vulnerabilities that are found will not be patched. We recommend that you begin migrating to OpenCensus tracing to OpenTelemetry, the successor project.
Using the OpenTelemetry-Go - OpenCensus Bridge, you can immediately begin exporting your traces with OpenTelemetry, even while dependencies such as the Google Cloud client libraries for Go remain instrumented with OpenCensus. If you do not use the bridge, you will need to migrate your entire application and all of its instrumented dependencies at once. For simple applications, this may be possible, but we expect the bridge to be helpful if multiple libraries with instrumentation are used.
One year after the Google Cloud Go client libraries release the experimental, opt-in OpenTelemetry tracing support in this PR (mid-Q4 2023), the prior experimental OpenCensus tracing will be removed.
Please refer to the following resources:
OpenTelemetry trace context propagation
The context propagation support for OpenCensus tracing (based on the Cloud Trace header) must be supplemented with new and separate context propagation support for OpenTelemetry tracing (based on the W3C Trace Context header). The
google.golang.org/api/transport
package currently configures context propagation for the Cloud Trace header (X-Cloud-Trace-Context). This is used in all Go client libraries, both HTTP and gRPC, Discovery (Apiary) and GAPIC.This PR adds support for by wrapping the underlying transport as follows:
Passing options to otelhttp.NewTransport in HTTP-based clients
Users who want to pass options to
otelhttp.NewTransport
can disable the library support in the transport package and configure the transport and client themselves.Note that scopes must be set manually in the user-configured solution.
Passing options to otelgrpc.NewClientHandler in gRPC-based clients
The setup is pretty similar in gRPC using the otelgrpc.NewClientHandler.