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

docs(context): Fix links, edit prose #2619

Merged
merged 11 commits into from
Jan 31, 2022

Conversation

spencerwilson
Copy link
Contributor

@spencerwilson spencerwilson commented Nov 12, 2021

Which problem is this PR solving?

  • Fix a couple dead links
  • Fix some styling ("JavaScript", "Node.js")
  • Add pointer to the Zone-based packages to help browser people
  • Elaborate on the two implementations provided by this package

Short description of the changes

Type of change

Please delete options that are not relevant.

  • This change requires a documentation update

^ I take it that since the updated docs aren't deployed anywhere, there's no other step needed.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@spencerwilson spencerwilson requested a review from a team November 12, 2021 01:55
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 12, 2021

CLA Signed

The committers are authorized under a signed CLA.

@vmarchaud vmarchaud added the document Documentation-related label Nov 14, 2021
@codecov
Copy link

codecov bot commented Nov 14, 2021

Codecov Report

Merging #2619 (5e9368a) into main (a824578) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2619   +/-   ##
=======================================
  Coverage   93.27%   93.27%           
=======================================
  Files         159      159           
  Lines        5444     5444           
  Branches     1141     1141           
=======================================
  Hits         5078     5078           
  Misses        366      366           


### Limitations
The former should be preferred over the latter as its implementation is substantially simpler than the latter's, and according to [Node.js docs](https://github.com/nodejs/node/blame/v17.1.0/doc/api/async_context.md#L42-L45),
Copy link
Member

Choose a reason for hiding this comment

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

AsyncLocalStorage isn't available for Node < 14.6 so we should document this there

Copy link
Member

@blumamir blumamir Jan 6, 2022

Choose a reason for hiding this comment

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

It is also available for node ^12.17 and node ^13.10

Copy link
Member

Choose a reason for hiding this comment

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

According to the node 14 docs it was introduced in 13.10 so I think it is available in all v14 versions.

Copy link
Member

@Flarna Flarna Jan 7, 2022

Choose a reason for hiding this comment

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

Please note that AsyncLocalStorage was added as experimental in 13.10 and it is still marked as experimental on 12 and 14 release lines (ignoring 13 and 15 for now as they are EOL anyway).

It was move out of experimental with 16.4.0.

There were several important fixes done in that area during the first 14.x releases resulting in using it only for >=14.8.0 in NodeTracerProvider.

I think all these fixes were backported to the 12.x line but most likely not with 12.17.0.

Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

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

LGTM.
Thanks for this great work

@blumamir
Copy link
Member

blumamir commented Jan 6, 2022

@spencerwilson Can you please fix the conflict and run lint:fix so CI is green?

> While you can create your own implementation [of `AsyncLocalStorage`] on top of [`AsyncHook`], `AsyncLocalStorage` should be preferred as it is a performant and memory safe implementation that involves significant optimizations that are non-obvious to implement.

`AsyncLocalStorage` is available in node `^12.17.0 || >= 13.10.0`, however `AsyncLocalStorageContextManager` is not enabled by default for node `<14.8.0` because of some important bugfixes which were introduced in `v14.8.0`.
For more information see [nodejs/node#34573](https://github.com/nodejs/node/pull/34573).
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is the only relevant fix, it's the latest one.

@spencerwilson
Copy link
Contributor Author

Thanks for all the reviews, everyone. I'll try to get this mergeable in the next few days.

@dyladan
Copy link
Member

dyladan commented Jan 19, 2022

@spencerwilson any update?

@spencerwilson
Copy link
Contributor Author

spencerwilson commented Jan 21, 2022

@dyladan apologies, I didn't get this in last weekend and weekends are likely the only time I'll have to do OTel things. I'm going to try to get this mergeable tomorrow or Sunday.

One question: Since my last commit I noticed that some Markdown docs in the JS repo(s?) are also published to opentelemetry.io (e.g., https://opentelemetry.io/docs/instrumentation/js/api/context/). Which type of links should I prefer to use in the Markdown: opentelemetry.io or github.com?

@dyladan
Copy link
Member

dyladan commented Jan 21, 2022

One question: Since my last commit I noticed that some Markdown docs in the JS repo(s?) are also published to opentelemetry.io (e.g., opentelemetry.io/docs/instrumentation/js/api/context). Which type of links should I prefer to use in the Markdown: opentelemetry.io or github.com?

website. the docs in the repo are actually meant to be deprecated and removed in favor of the website we just haven't gotten around to it yet

@spencerwilson
Copy link
Contributor Author

Hrm, I was unable to run Markdown lint locally so I just went off of what I saw in the previous workflow logs. Had some trouble installing dependencies and lack experience with lerna to quickly know what's going on.

% npm i

> [email protected] postinstall
> npm run update-ts-references && npm run bootstrap


> [email protected] update-ts-references
> update-ts-references

updating tsconfigs
NO tsconfig.json for @opentelemetry/selenium-tests

> [email protected] bootstrap
> lerna bootstrap --hoist --nohoist='zone.js'

lerna notice cli v3.22.1
lerna info Bootstrapping 20 packages
lerna WARN EHOIST_ROOT_VERSION The repository root depends on [email protected], which differs from the more common semver@^7.3.5.
lerna WARN EHOIST_PKG_VERSION "@opentelemetry/sdk-trace-node" package depends on semver@^7.3.5, which differs from the hoisted [email protected].
lerna WARN EHOIST_PKG_VERSION "propagation-validation-server" package depends on @opentelemetry/api@^1.0.3, which differs from the hoisted @opentelemetry/api@~1.0.3.
lerna WARN EHOIST_PKG_VERSION "@opentelemetry/exporter-trace-otlp-grpc" package depends on @opentelemetry/api@^1.0.3, which differs from the hoisted @opentelemetry/api@~1.0.3.
lerna WARN EHOIST_PKG_VERSION "@opentelemetry/exporter-trace-otlp-http" package depends on @opentelemetry/api@^1.0.3, which differs from the hoisted @opentelemetry/api@~1.0.3.
lerna WARN EHOIST_PKG_VERSION "@opentelemetry/exporter-trace-otlp-proto" package depends on @opentelemetry/api@^1.0.3, which differs from the hoisted @opentelemetry/api@~1.0.3.
lerna WARN EHOIST_PKG_VERSION "@opentelemetry/exporter-jaeger" package depends on @opentelemetry/api@^1.0.3, which differs from the hoisted @opentelemetry/api@~1.0.3.
lerna WARN EHOIST_PKG_VERSION "@opentelemetry/exporter-zipkin" package depends on @opentelemetry/api@^1.0.3, which differs from the hoisted @opentelemetry/api@~1.0.3.
lerna WARN EHOIST_PKG_VERSION "@opentelemetry/selenium-tests" package depends on @opentelemetry/api@^1.0.3, which differs from the hoisted @opentelemetry/api@~1.0.3.
lerna WARN EHOIST_PKG_VERSION "@opentelemetry/selenium-tests" package depends on [email protected], which differs from the hoisted [email protected].
lerna info Installing external dependencies
lerna info hoist Installing hoisted dependencies into root
lerna info hoist Pruning hoisted dependencies
lerna info hoist Finished pruning hoisted dependencies
lerna ERR! npm install exited 1 in 'opentelemetry'
lerna ERR! npm install stderr:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/webpack
npm ERR!   webpack@"4.46.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^5.1.0" from [email protected]
npm ERR! node_modules/terser-webpack-plugin
npm ERR!   terser-webpack-plugin@"5.2.5" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

@spencerwilson
Copy link
Contributor Author

A couple flaky tests, looks like:

  1) OTLPTraceExporter - node with TLS, without metadata
       export
         should export spans:

      Uncaught AssertionError [ERR_ASSERTION]: resource doesn't exist
      + expected - actual

      -false
      +true
      
      at Timeout._onTimeout (test/OTLPTraceExporter.test.ts:175:18)
      at listOnTimeout (internal/timers.js:554:17)
      at processTimers (internal/timers.js:497:7)

  2) OTLPTraceExporter - node without TLS, without metadata
       export
         should export spans:

      Uncaught AssertionError [ERR_ASSERTION]: resource doesn't exist
      + expected - actual

      -false
      +true
      
      at Timeout._onTimeout (test/OTLPTraceExporter.test.ts:175:18)
      at listOnTimeout (internal/timers.js:554:17)
      at processTimers (internal/timers.js:497:7)

I've merged main to get a few more commits but none look like they'll influence these two tests.

*   81626216 (HEAD -> sw/context-docs) Merge branch 'main' of https://github.com/open-telemetry/opentelemetry-js into sw/context-docs
|\
| * e1c32b2d (upstream/main) feat(views): add FilteringAttributesProcessor (#2733)
| * 8daaddc6 feat(sdk-metrics-base): document and export basic APIs (#2725)
| * 63cff1cb chore: update actions/checkout to v2 (#2715)
* | 6e5ab03a (origin/sw/context-docs) docs(lint): maybe fix things

@dyladan
Copy link
Member

dyladan commented Jan 27, 2022

Flaky tests aren't your fault

@vmarchaud vmarchaud merged commit ce5f7f7 into open-telemetry:main Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
document Documentation-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants