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

Reorg manual tracing JS docs based on SDK #1445

Merged
merged 9 commits into from
Jun 30, 2022

Conversation

cartermp
Copy link
Contributor

@cartermp cartermp commented Jun 14, 2022

This is built on #1435 out of convenience, but I'm unopinionated on which order to pull in things.

Fixes #1436

I had to kind of reorg the manual instrumentation docs a bit for JS here. I also decided to pull in some text from other docs to clarify some sections, and linkify some concepts as well now that we have language-agnostic concepts.

Happy to break stuff out if that helps with review.

Since y'all aren't code owners yet, tagging @open-telemetry/javascript-approvers to take a look. I have no doubt that there may be a few technical inaccuracies here that I'd like to catch before merging 🙂


Preview: https://deploy-preview-1445--opentelemetry.netlify.app/docs/instrumentation/js/instrumentation/

@cartermp cartermp requested a review from a team June 14, 2022 23:21
@cartermp cartermp changed the title Simplify and make js manual doc more correct Reorg manual tracing JS docs based on SDK Jun 14, 2022
@cartermp cartermp requested a review from a team June 15, 2022 23:20
@dyladan
Copy link
Member

dyladan commented Jun 16, 2022

I added comments on #1435 but reviewing two documents which both touch a lot of things is difficult to know which PR the comment "belongs" on. Some of those comments may be addressed here?

@cartermp
Copy link
Contributor Author

Thanks @dyladan - and sorry for the confusion. I'll close #1435 and bring your feedback over to address

Copy link
Contributor Author

@cartermp cartermp left a comment

Choose a reason for hiding this comment

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

Pulling in feedback from @dyladan

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

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

Nice work! Just a few comments.

content/en/docs/instrumentation/js/instrumentation.md Outdated Show resolved Hide resolved
```

By default, the status for all spans is `Unset` rather than `Ok`. It is
typically the job of another component in your telemetry pipeline to interpret
the `Unset` status of a span, so it's best not to override this unless you're
Copy link
Member

Choose a reason for hiding this comment

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

This statement sounds to me like suggesting users to not set the status code OK. Am I understanding this correctly?

Copy link
Contributor Author

@cartermp cartermp Jun 17, 2022

Choose a reason for hiding this comment

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

Yep. It's at least my understanding that unless you're an instrumentation library author, you shouldn't set the status to Ok, but leave it as Unset for a processor or backend to interpret.

Choose a reason for hiding this comment

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

Could you elaborate on why that is? Wouldn't the application dev know whether the span completed or not?

Copy link
Member

@dyladan dyladan 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 consolidating to a single PR

content/en/docs/instrumentation/js/instrumentation.md Outdated Show resolved Hide resolved
content/en/docs/instrumentation/js/instrumentation.md Outdated Show resolved Hide resolved
content/en/docs/instrumentation/js/instrumentation.md Outdated Show resolved Hide resolved
content/en/docs/instrumentation/js/instrumentation.md Outdated Show resolved Hide resolved
@cartermp
Copy link
Contributor Author

Okay, should be good for (hopefully final?) review. I moved the tracing init stuff to CJS modules. It seems to be the least headache to use right now in the sample apps I'm using as I document stuff. Once ESM is properly supported in the SDK we'll probably want to figure out a way to show both options and instructions for running.

Copy link
Member

@austinlparker austinlparker left a comment

Choose a reason for hiding this comment

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

lgtm outside of some nits

content/en/docs/instrumentation/js/instrumentation.md Outdated Show resolved Hide resolved
content/en/docs/instrumentation/js/instrumentation.md Outdated Show resolved Hide resolved
Copy link
Member

@svrnm svrnm left a comment

Choose a reason for hiding this comment

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

Added a few comments, my main concerns are the following:

  • by removing the example application it's much harder to follow the flow
  • see my comment on tracing.js, it's not clear why the code is separated out like for auto instrumentation (where a "don't touch my code" experience is nice). If the goal is to separate SDK & API this should be called out to not confuse the user.

@chalin chalin self-assigned this Jun 21, 2022
@chalin
Copy link
Contributor

chalin commented Jun 28, 2022

@svrnm - this good to go?

@svrnm
Copy link
Member

svrnm commented Jun 29, 2022

@svrnm - this good to go?

There are still 2 things open for me:

  • minor: Creating nested spans with sdk-trace-base needs to be a level 3 heading
  • major: I still think that having a sample app people can use to try things out would be valuable, I am not going to die on that hill if I am outvoted, but I'd like to have that clarified.

@dyladan
Copy link
Member

dyladan commented Jun 29, 2022

I appreciate the value of a sample app, but I think this PR is already pretty large and is already such an improvement over the existing document that it should be accepted and a sample can be taken as a follow up task.

@chalin
Copy link
Contributor

chalin commented Jun 29, 2022

I appreciate the value of a sample app, but I think this PR is already pretty large and is already such an improvement over the existing document that it should be accepted and a sample can be taken as a follow up task.

+1

@svrnm - your first point has been addressed, and I agree iwth @dyladan that further changes should be addresses separately. Might you be willing to approve this PR as is?

Copy link
Member

@vmarchaud vmarchaud left a comment

Choose a reason for hiding this comment

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

overall lgtm, nit pick that would better if people modify the init script later on though

content/en/docs/instrumentation/js/instrumentation.md Outdated Show resolved Hide resolved
@svrnm
Copy link
Member

svrnm commented Jun 29, 2022

I appreciate the value of a sample app, but I think this PR is already pretty large and is already such an improvement over the existing document that it should be accepted and a sample can be taken as a follow up task.

+1

@svrnm - your first point has been addressed, and I agree iwth @dyladan that further changes should be addresses separately. Might you be willing to approve this PR as is?

@dyladan , @chalin : all I suggest is keeping the existing sample app:

https://opentelemetry.io/docs/instrumentation/js/instrumentation/
vs
https://deploy-preview-1445--opentelemetry.netlify.app/docs/instrumentation/js/instrumentation/

But I don't want to block the PR, we can re-introduce it in a follow up.

@cartermp
Copy link
Contributor Author

I'd also like to think about what a good sample looks like such that each subsection could be meaningfully applied in a way that doesn't feel arbitrary/strange. It might also be good to settle if we want to do something like that for all the manual instrumentation pages. Currently, none of them work off of a common sample/scenario.

@svrnm
Copy link
Member

svrnm commented Jun 30, 2022

I closed my outstanding conversations as well, so we can move that "sample app" discussion to an issue for now.

Copy link
Contributor

@chalin chalin left a comment

Choose a reason for hiding this comment

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

Thanks @cartermp & all for your efforts!

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.

Which JS SDK should be used in manual instrumentation docs?
9 participants