Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-resources): add runtime version information #2727
feat(opentelemetry-resources): add runtime version information #2727
Changes from 7 commits
7ce4389
7bd392f
8607046
1827b95
304edad
abcf4a0
ee76a6c
d25b453
3d36a7c
caea930
b8e73c6
d78d714
478cab0
1f1ca09
c749614
508fce0
abb3d3a
09236f6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The detectors were moved to the
src/detectors
folder so that we can have a consistent export on both Node.js and Web environments. Anddetector.detect
will do nothing if the environment is not the expected one, like https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-resources/src/detectors/ProcessDetector.ts#L30.Could you move the BrowserDetector to
src/detectors
too so that it can be exported unconditionally?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
util.inspect
is not available on the Web, that's why it is located in thesrc/platform/node
so that it won't be bundled in the web applications. Moving this API out ofsrc/platform/node
makes it unusable on Web environments. I think this change could be separated into another PR to makedetectResource
Web compatible.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will file an issue for this and work on it in another pr. thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sinon.stub
should be preferred to create mocks. Alsoglobal
is not a standard global alias in browser environment, please useglobalThis
instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
tried to
but got
TypeError: Cannot stub non-existent property window
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is that these tests are run on the Node.js environment, which is not expected. I'm filed #2739 to fix this. I don't want to block this PR for #2739. So I'm ok with this as is.