-
Notifications
You must be signed in to change notification settings - Fork 825
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
fix(instrumentation-fetch, instrumentation-xml-http-request) content length attributes missing #5257
base: next
Are you sure you want to change the base?
Conversation
CHANGELOG.md
Outdated
@@ -16,6 +16,7 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se | |||
### :bug: (Bug Fix) | |||
|
|||
* fix(sdk-trace-base): do not load OTEL_ env vars on module load, but when needed [#5224](https://github.com/open-telemetry/opentelemetry-js/pull/5224) | |||
* fix(instrumentation-xhr, instrumentation-fetch): content length attributes no longer get removed with `ignoreNetworkEvents: true` being set [#5229](https://github.com/open-telemetry/opentelemetry-js/issues/5229) |
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.
sorry for our confusing changelog setup :/
this should go into CHANGELOG_NEXT.md
on this branch.
The fix from main
will already be included once this version is released (February), so you can just document the breaking change to sdk-trace-web
as feat(sdk-trace-web)!: ...
🙂
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.
Let me know if it looks good now. I had a bunch of meetings but am free now.
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.
thank you for working on this :)
only one changelog nit that we should address, and then we can get this merged 🙂
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #5257 +/- ##
=======================================
Coverage 94.56% 94.56%
=======================================
Files 316 316
Lines 8037 8037
Branches 1628 1628
=======================================
Hits 7600 7600
Misses 437 437 |
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.
looks good, thank you 🙂
Which problem is this PR solving?
http.response_content_length
andhttp.response_content_length_uncompressed
attributes are not present on network spans frominstrumentation-xml-http-request
andinstrumentation-fetch
plugins when theignoreNetworkEvents
configuration property is set totrue
This PR adds the
addSpanContentLengthAttributes
utility method to@opentelemetry/sdk-trace-web
removing the logic for adding content length related attributes from theaddSpanNetworkEvents
method.Fixes #5229
Short description of the changes
By skipping over the call to
addSpanNetworkEvents
the mentioned attributes were not getting added to the main and preflight network spans. We moved the logic for adding the content length attributes to the newaddSpanContentLengthAttributes
method. This new method will be called regardless of ifignoreNetworkEvents
is set totrue
in the config.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Automated unit tests were written as well as testing with the fetch and xhr examples to verify the attributes are being added with the proposed code.
Checklist: