-
Notifications
You must be signed in to change notification settings - Fork 805
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
chore: require value in setAttribute #1851
chore: require value in setAttribute #1851
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1851 +/- ##
==========================================
+ Coverage 92.35% 92.72% +0.37%
==========================================
Files 157 174 +17
Lines 5104 6038 +934
Branches 1085 1283 +198
==========================================
+ Hits 4714 5599 +885
- Misses 390 439 +49
|
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 agree with @Flarna that !=
will catch more cases than !==
without overly complicating the code, but this is a matter of preference. Since null/undefined are technically undefined behavior it might not matter that much.
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
packages/opentelemetry-instrumentation-xml-http-request/test/xhr.test.ts
Outdated
Show resolved
Hide resolved
@@ -112,7 +112,9 @@ export class FetchInstrumentation extends InstrumentationBase< | |||
): void { | |||
const parsedUrl = web.parseUrl(response.url); | |||
span.setAttribute(HttpAttribute.HTTP_STATUS_CODE, response.status); | |||
span.setAttribute(HttpAttribute.HTTP_STATUS_TEXT, response.statusText); | |||
if (response.statusText != undefined) { |
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.
nit: !== undefined
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 think we may end up stuck in a loop #1851 (comment)
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de> Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de> Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Which problem is this PR solving?
Short description of the changes