Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ For notes on migrating to 2.x / 0.200.x see [the upgrade guide](doc/upgrade-to-2

### :bug: Bug Fixes

* fix(instrumentation-xhr): resolve relative URLs before matching `ignoreUrls` [#6551](https://github.com/open-telemetry/opentelemetry-js/pull/6551) @Maximiliano-Zeballos
* fix(instrumentation-fetch): preserve init overrides when input is a Request object [#6421](https://github.com/open-telemetry/opentelemetry-js/issues/6421) @akandic47
Comment thread
pichlermarc marked this conversation as resolved.
Outdated
* fix(sdk-node): fix setting of ViewOption#name from ConfigurationModel [#6620](https://github.com/open-telemetry/opentelemetry-js/pull/6620) @trentm
* fix(web-common): add limit for timeout [#6601](https://github.com/open-telemetry/opentelemetry-js/pull/6601) @maryliag

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,13 @@ export class XMLHttpRequestInstrumentation extends InstrumentationBase<XMLHttpRe
url: string,
method: string
): api.Span | undefined {
if (isUrlIgnored(url, this.getConfig().ignoreUrls)) {
const parsedUrl = parseUrl(url);
if (isUrlIgnored(parsedUrl.href, this.getConfig().ignoreUrls)) {
this._diag.debug('ignoring span as url matches ignored url');
return;
}

let name = '';
const parsedUrl = parseUrl(url);
const attributes = {} as api.Attributes;
if (this._semconvStability & SemconvStability.OLD) {
name = method.toUpperCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,19 @@ describe('xhr', () => {
});
});

describe('when relative url is ignored via domain regex', () => {
beforeEach(done => {
clearData();
prepareData(done, '/xml-http-request.js', {
propagateTraceHeaderCorsUrls: [/.*/],
ignoreUrls: [/.*localhost.*/],
});
});

it('should NOT create any span', () => {
assert.ok(exportSpy.notCalled, "span shouldn't be exported");
});
});
describe('when clearTimingResources is set', () => {
beforeEach(done => {
clearData();
Expand Down
Loading