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

Instrument with open tracing #6347

Merged
merged 25 commits into from
Jul 11, 2018

Conversation

Moocar
Copy link
Contributor

@Moocar Moocar commented Jul 9, 2018

Add tracing to Gatsby! This PR adds open tracing instrumentation to Gatsby so that the following spans are automatically traced:

  • Top level build spans
  • Bootstrap activities
  • API calls (and their implementing plugins)

The traces can be viewed with any open tracing compatible backend by adding the appropriate library dependency and passing its configuration via the new --open-tracing-config-file command line option.

Documentation on how to use it is provided in the new /docs/performance-tracing.md doc.

Background information on why this approach to tracing was chosen can be found in #1074

I'm still relatively new to the javascript world, so syntax level feedback would be very much appreciated.

@Moocar
Copy link
Contributor Author

Moocar commented Jul 9, 2018

Note: This shouldn't be merged until DanielMSchmidt/zipkin-javascript-opentracing#68 has been merged.

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jul 9, 2018

Deploy preview for using-drupal ready!

Built with commit ea26228

https://deploy-preview-6347--using-drupal.netlify.com

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jul 9, 2018

Deploy preview for gatsbygram ready!

Built with commit ea26228

https://deploy-preview-6347--gatsbygram.netlify.com

@KyleAMathews
Copy link
Contributor

Fantastic work! So excited about this. Could you post a screenshot or two of some sample traces?

Re) code style — looks good to me. We do use Prettier for formatting so run npm run format from the root of the repo (if you haven't) to clean that up.

KyleAMathews
KyleAMathews previously approved these changes Jul 9, 2018
@Moocar
Copy link
Contributor Author

Moocar commented Jul 10, 2018

Cool, added an image in the docs and ran format

m-allanson
m-allanson previously approved these changes Jul 10, 2018
Copy link
Contributor

@m-allanson m-allanson left a comment

Choose a reason for hiding this comment

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

Nice, thanks @Moocar 👌

@m-allanson m-allanson changed the title Instrument with open tracing [blocked]Instrument with open tracing Jul 10, 2018
@m-allanson
Copy link
Contributor

I nearly merged this - so I'll repeat @Moocar's comment above - don't merge this until this PR has been merged.


async function stopTracer() {
if (tracerProvider) {
if (tracerProvider.stop) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This was the only syntax nitpick I could find - you could also write it as if (tracerProvider && tracerProvider.stop) {

I'll be over here painting my bikeshed.

@m-allanson m-allanson changed the title [blocked]Instrument with open tracing Instrument with open tracing Jul 11, 2018
Copy link
Contributor

@m-allanson m-allanson left a comment

Choose a reason for hiding this comment

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

@Moocar I fixed up the merge conflicts since #6226 was merged in. Once the tests are green for this, I'll merge and release 👍

@m-allanson
Copy link
Contributor

That failed Netlify build is a red herring. Merging, thanks again @Moocar!

@m-allanson m-allanson merged commit d863bcb into gatsbyjs:master Jul 11, 2018
@m-allanson
Copy link
Contributor

Published as [email protected]

@jlengstorf
Copy link
Contributor

Hiya @Moocar! 👋

This is definitely late, but on behalf of the entire Gatsby community, I wanted to say thank you for being here.

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (We’ve got t-shirts and hats, plus some socks that are really razzing our berries right now.)
  2. If you’re not already part of it, we just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. You’ll receive an email shortly asking you to confirm. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If you have questions, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again! 💪💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants