Skip to content

Commit

Permalink
Merge branch 'main' into rrweb
Browse files Browse the repository at this point in the history
  • Loading branch information
t2t2 committed Sep 12, 2022
2 parents 3fbdfd6 + 58f73ab commit 5838828
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ release_production:
only:
- /^v[0-9]+\..*/
script:
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 23F3D4EA75716059
- sudo apt-add-repository https://cli.github.com/packages
- sudo apt update
- sudo apt install gh
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ If the version of Open Telemetry is unspecified for a version, then it is the sa

## Unreleased

## 0.12.3 & 0.12.2

- Fix errors caused by disabled postload instrumentation ([#433](https:/signalfx/splunk-otel-js-web/pull/433))

## 0.12.1

- Add app version configuration option ([#419](https:/signalfx/splunk-otel-js-web/pull/419))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Compatibility between the versions of this project and Open Telemetry is specifi

Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on building, running tests, and so forth.

## License and versioning
## License

The Splunk distribution of OpenTelemetry JavaScript Browser is a distribution
of the [OpenTelemetry JavaScript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,13 @@ module.exports = {
await browser.assert.not.ok(plScriptRootSpan.parentId);
await browser.assert.equal(plScriptParentSpan.traceId, plScriptChildSpan.traceId);
await browser.assert.equal(plScriptChildSpan.parentId, plScriptParentSpan.id);
},
'doesn\'t crash when postload instrumentation is disabled': async function(browser) {
await browser.url(browser.globals.getUrl('/resource-observer/resources-custom-context.ejs'));
await browser.click('#btn1');

const click = await browser.globals.findSpan(span => span.name === 'click');
await browser.assert.ok(click);
await browser.global.assertNoErrorSpans();
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Resource observer test</title>
<%- renderAgent({ instrumentations: { postload: false }}) %>
</head>
<body>
<h1>Resource observer test</h1>

<button type="button" id="btn1">Button</button>

<pre id="scenarioDisplay"></pre>
<script id="scenario">
btn1.addEventListener('click', function () {});
</script>
<script>scenarioDisplay.innerHTML = scenario.innerHTML;</script>
</body>
</html>
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splunk/otel-web",
"version": "0.12.1-rrweb.0",
"version": "0.12.3-rrweb.0",
"description": "Splunk distribution of Open Telemetry for browser environment.",
"repository": "github:signalfx/splunk-otel-js-browser",
"scripts": {
Expand Down Expand Up @@ -92,7 +92,7 @@
"browserstack-local": "^1.4.8",
"chai": "^4.3.4",
"chrome-launcher": "^0.15.0",
"chromedriver": "^103.0.0",
"chromedriver": "^105.0.0",
"codecov": "^3.8.2",
"compression": "^1.7.4",
"cors": "^2.8.5",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ export const SplunkRum: SplunkOtelWebType = {
provider.register({
contextManager: new SplunkContextManager({
...processedOptions.context,
onBeforeContextStart: () => _postDocLoadInstrumentation.onBeforeContextChange(),
onBeforeContextEnd: () => _postDocLoadInstrumentation.onBeforeContextChange(),
onBeforeContextStart: () => _postDocLoadInstrumentation?.onBeforeContextChange(),
onBeforeContextEnd: () => _postDocLoadInstrumentation?.onBeforeContextChange(),
})
});

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ limitations under the License.
*/

// this is an autogenerated file, see scripts/version-update.js
export const VERSION = '0.12.1-rrweb.0';
export const VERSION = '0.12.3-rrweb.0';

0 comments on commit 5838828

Please sign in to comment.