Skip to content

Commit

Permalink
Merge branch 'main' into deps/fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan authored Nov 22, 2022
2 parents e3da68a + 3290b25 commit b43081a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
4 changes: 4 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ All notable changes to experimental packages in this project will be documented

### :bug: (Bug Fix)

* fix(instrumentation-xhr): http.url attribute should be absolute [#3200](https://github.com/open-telemetry/opentelemetry-js/pull/3200) @t2t2

### :books: (Refine Doc)

### :house: (Internal)

* chore(otlp-proto-exporter-base): upgrade protobufjs to 7.1.2 and relax versioning [#3433](https://github.com/open-telemetry/opentelemetry-js/pull/3433) @seemk

## 0.34.0

* `@opentelemetry/sdk-metrics` moved to [packages/sdk-metrics](../packages/sdk-metrics)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,17 @@ describe('fetch', () => {
`event ${PTN.REQUEST_START} is not defined`
);
});

it('should have an absolute http.url attribute', () => {
const span: tracing.ReadableSpan = exportSpy.args[0][0][0];
const attributes = span.attributes;

assert.strictEqual(
attributes[SemanticAttributes.HTTP_URL],
location.origin + '/get',
`attributes ${SemanticAttributes.HTTP_URL} is wrong`
);
});
});

describe('when PerformanceObserver is undefined', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export class XMLHttpRequestInstrumentation extends InstrumentationBase<XMLHttpRe
kind: api.SpanKind.CLIENT,
attributes: {
[SemanticAttributes.HTTP_METHOD]: method,
[SemanticAttributes.HTTP_URL]: url,
[SemanticAttributes.HTTP_URL]: parseUrl(url).toString(),
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,17 @@ describe('xhr', () => {
`event ${PTN.REQUEST_START} is not defined`
);
});

it('should have an absolute http.url attribute', () => {
const span: tracing.ReadableSpan = exportSpy.args[0][0][0];
const attributes = span.attributes;

assert.strictEqual(
attributes[SemanticAttributes.HTTP_URL],
location.origin + '/get',
`attributes ${SemanticAttributes.HTTP_URL} is wrong`
);
});
});

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"dependencies": {
"@opentelemetry/core": "1.8.0",
"@opentelemetry/otlp-exporter-base": "0.34.0",
"protobufjs": "7.1.1"
"protobufjs": "^7.1.2"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-proto-exporter-base",
"sideEffects": false
Expand Down

0 comments on commit b43081a

Please sign in to comment.