Skip to content
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: add support for OTel context propagation and harmonized spans #1833

Open
wants to merge 134 commits into
base: main
Choose a base branch
from

Conversation

feywind
Copy link
Collaborator

@feywind feywind commented Sep 20, 2023

This PR adds support for OTel context propagation using the standard W3C headers as Pub/Sub attributes. It also harmonizes the spans we're using with the planned spans in other language libraries.

Fixes #1389

(This is the 4.x version of #1659 - I'll still be backporting to there, but the changes will go here first.)

feywind and others added 30 commits December 12, 2022 16:28
@feywind
Copy link
Collaborator Author

feywind commented Mar 21, 2024

@naseemkullah The delay has been annoying for sure. The good news is, this is being reviewed in pieces and there will hopefully be a beta release soon.

@feywind
Copy link
Collaborator Author

feywind commented Mar 21, 2024

There's one more of these in the review queue right now:
feywind#5

Some fabulous people on our side have been working to harmonize our span design a bit more with the OTel working group's design in progress for message tracing. :)

@feywind
Copy link
Collaborator Author

feywind commented Mar 22, 2024

@hongalex The sample needs updating, but this should more or less be the finished PR now. Thanks for all the review help.

@feywind feywind added the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 4, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 4, 2024
@feywind
Copy link
Collaborator Author

feywind commented Apr 4, 2024

This is now testable in beta form. I installed in a test project like so:

npm i --save @google-cloud/pubsub@otel-beta

The resulting package.json looks like this:

{
  "dependencies": {
    "@google-cloud/opentelemetry-cloud-trace-exporter": "^2.1.0",
    "@google-cloud/pubsub": "^4.3.3-otel-beta.1",
    "@opentelemetry/sdk-trace-node": "^1.23.0",
    "@opentelemetry/semantic-conventions": "^1.23.0"
  }
}

And then you can take a look at this sample for how to use it from JS, or this sample for how to use it from TS.

We've got more reviewing to do, and merges aren't going to happen for at least a week, but this may at least make it easier to do some testing if you like.

Further updates (for now) will come in as 4.3.3-otel-beta.2, etc, and will update the tag otel-beta on npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. do not merge Indicates a pull request not ready for merge, due to either quality or timing. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenTelemetry integration misses the point: we need to propagate the span/context!
6 participants