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: Opentelemetry integration #1078

Merged
merged 36 commits into from
Aug 14, 2020

Conversation

sethmaxwl
Copy link
Contributor

Adds OpenTelemetry tracing to messages in order to provide more visibility into how messages are behaving behind the scenes. @opentelemetry/api and @opentelemetry/tracing are added as dependencies.

Fixes #1061

sethmaxwl and others added 12 commits July 27, 2020 20:45
* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* fix: rename _toc to toc

Source-Author: F. Hinkelmann <franziska.hinkelmann@gmail.com>
Source-Date: Tue Jul 21 10:53:20 2020 -0400
Source-Repo: googleapis/synthtool
Source-Sha: 99c93fe09f8c1dca09dfc0301c8668e3a70dd796
Source-Link: googleapis/synthtool@99c93fe

Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
Source-Author: F. Hinkelmann <franziska.hinkelmann@gmail.com>
Source-Date: Thu Jul 23 01:45:04 2020 -0400
Source-Repo: googleapis/synthtool
Source-Sha: 3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3
Source-Link: googleapis/synthtool@3a00b7f
@sethmaxwl sethmaxwl requested review from a team as code owners August 7, 2020 15:45
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 7, 2020
@sethmaxwl sethmaxwl changed the title Opentelemetry integration feat: Opentelemetry integration Aug 7, 2020
Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few notes/nits.

My main feedback is that I would start by making the open telemetry feature optional. If you made it configurable with an environment variable, we could start by having select customers enable this environment variable places like GCF/Cloud Run.

I want to be very mindful of customers who are running PubSub out of GCP environments, e.g., other clouds.

package.json Outdated Show resolved Hide resolved
samples/package.json Show resolved Hide resolved
src/publisher/index.ts Outdated Show resolved Hide resolved
src/publisher/index.ts Outdated Show resolved Hide resolved
src/subscriber.ts Outdated Show resolved Hide resolved
@feywind
Copy link
Collaborator

feywind commented Aug 7, 2020

Thanks for doing this @sethmaxwl and also thanks for the review @bcoe! I agree with what Ben's saying, re: what I wrote above, that we want this to basically be invisible for existing users until they opt in. It sounds like the dependencies are okay, we just want to avoid having it do anything new without an opt-in.

The CI issues look like they're mostly about an ongoing TypeScript version issue. I'm working on a fix for that so we can get several PRs back on track.

@codecov
Copy link

codecov bot commented Aug 8, 2020

Codecov Report

Merging #1078 into master will increase coverage by 2.71%.
The diff coverage is 91.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1078      +/-   ##
==========================================
+ Coverage   95.06%   97.78%   +2.71%     
==========================================
  Files          24       25       +1     
  Lines       10925    11067     +142     
  Branches      483      546      +63     
==========================================
+ Hits        10386    10822     +436     
+ Misses        535      241     -294     
  Partials        4        4              
Impacted Files Coverage Δ
src/subscriber.ts 98.67% <86.04%> (-0.92%) ⬇️
src/publisher/index.ts 97.61% <90.47%> (+36.01%) ⬆️
src/opentelemetry-tracing.ts 100.00% <100.00%> (ø)
src/pubsub.ts 99.54% <0.00%> (+0.15%) ⬆️
src/message-stream.ts 98.71% <0.00%> (+0.25%) ⬆️
src/publisher/message-batch.ts 100.00% <0.00%> (+22.44%) ⬆️
src/publisher/message-queues.ts 98.68% <0.00%> (+48.68%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80e0ee3...d5ac567. Read the comment docs.

@bcoe bcoe added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 8, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 8, 2020
samples/package.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@feywind feywind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking pretty good, just left a couple more nits...

Let me see if I can get kokoro running the sample tests.

@@ -30,7 +30,7 @@
"presystem-test": "npm run compile",
"system-test": "mocha build/system-test --timeout 600000",
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
"test": "c8 mocha build/test",
"test": "c8 mocha build/test --recursive",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've got a change pending actually that will obsolete this, but I will deal with it when that gets merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added it here to get CI to run the publisher tests too.

}, SUBSCRIBER_TIMEOUT * 1000);
}

publishMessage().then(subscriptionListen());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing a doc end tag, though it may not matter at this point if nothing in the docsite is expecting it to be here. (We would need to canonicalize the the tag name anyway.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to include a link to this example in the blog post. How should we canonicalize the tag name?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me see if I can find the right person to ask... there were some changes in that area lately.

@feywind feywind added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 13, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 13, 2020
@sethmaxwl sethmaxwl requested a review from bcoe August 13, 2020 21:18
@feywind feywind added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 13, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 13, 2020
Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my feedback 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add OpenTelemetry Support
5 participants