Skip to content

Commit

Permalink
remove zone.js from user-interaction instrumentation (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
t2t2 authored Dec 4, 2023
1 parent d4f5797 commit f462003
Show file tree
Hide file tree
Showing 12 changed files with 1,906 additions and 2,901 deletions.
4,251 changes: 1,361 additions & 2,890 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion packages/web/integration-tests/tests/fetch/fetch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ module.exports = {
if (browser.options.desiredCapabilities.browserName !== 'Safari' && browser.options.desiredCapabilities.browser_version !== '10.1') {
await browser.timesMakeSense(fetchSpan.annotations, 'domainLookupStart', 'domainLookupEnd');
await browser.timesMakeSense(fetchSpan.annotations, 'connectStart', 'connectEnd');
await browser.timesMakeSense(fetchSpan.annotations, 'secureConnectionStart', 'connectEnd');
if (browser.globals.enableHttps) {
await browser.timesMakeSense(fetchSpan.annotations, 'secureConnectionStart', 'connectEnd');
}
await browser.timesMakeSense(fetchSpan.annotations, 'requestStart', 'responseStart');
await browser.timesMakeSense(fetchSpan.annotations, 'responseStart', 'responseEnd');
await browser.timesMakeSense(fetchSpan.annotations, 'fetchStart', 'responseEnd');
Expand Down
4 changes: 3 additions & 1 deletion packages/web/integration-tests/tests/xhr/xhr-basic.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ module.exports = {
})) {
await browser.timesMakeSense(xhrSpan.annotations, 'domainLookupStart', 'domainLookupEnd');
await browser.timesMakeSense(xhrSpan.annotations, 'connectStart', 'connectEnd');
await browser.timesMakeSense(xhrSpan.annotations, 'secureConnectionStart', 'connectEnd');
if (browser.globals.enableHttps) {
await browser.timesMakeSense(xhrSpan.annotations, 'secureConnectionStart', 'connectEnd');
}
await browser.timesMakeSense(xhrSpan.annotations, 'requestStart', 'responseStart');
await browser.timesMakeSense(xhrSpan.annotations, 'responseStart', 'responseEnd');
await browser.timesMakeSense(xhrSpan.annotations, 'fetchStart', 'responseEnd');
Expand Down
6 changes: 2 additions & 4 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"@opentelemetry/instrumentation": "^0.44.0",
"@opentelemetry/instrumentation-document-load": "^0.33.2",
"@opentelemetry/instrumentation-fetch": "^0.44.0",
"@opentelemetry/instrumentation-user-interaction": "^0.33.2",
"@opentelemetry/instrumentation-xml-http-request": "^0.44.0",
"@opentelemetry/resources": "^1.17.1",
"@opentelemetry/sdk-trace-base": "^1.17.1",
Expand All @@ -80,7 +79,7 @@
"browserstack-local": "^1.5.3",
"chai": "^4.3.7",
"chrome-launcher": "^1.0.0",
"chromedriver": "^117.0.3",
"chromedriver": "^119.0.1",
"codecov": "^3.8.2",
"compression": "^1.7.4",
"cors": "^2.8.5",
Expand Down Expand Up @@ -112,8 +111,7 @@
"socket.io": "^4.7.1",
"socket.io-client": "^4.7.1",
"ts-node": "^10.9.1",
"ws": "^8.13.0",
"zone.js": "0.11.4"
"ws": "^8.13.0"
},
"bugs": {
"url": "https://github.com/signalfx/splunk-otel-js-web/issues"
Expand Down
6 changes: 4 additions & 2 deletions packages/web/src/SplunkUserInteractionInstrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ limitations under the License.
*/

import { Span, trace, Tracer, TracerProvider } from '@opentelemetry/api';
import { UserInteractionInstrumentation } from '@opentelemetry/instrumentation-user-interaction';
import { UserInteractionInstrumentationConfig } from '@opentelemetry/instrumentation-user-interaction/build/src/types';
import { UserInteractionInstrumentation } from './upstream/user-interaction/instrumentation';
// import { UserInteractionInstrumentation } from '@opentelemetry/instrumentation-user-interaction';
import { UserInteractionInstrumentationConfig } from './upstream/user-interaction/types';
// import { UserInteractionInstrumentationConfig } from '@opentelemetry/instrumentation-user-interaction/build/src/types';

export type UserInteractionEventsConfig = {
[type: string]: boolean;
Expand Down
23 changes: 23 additions & 0 deletions packages/web/src/upstream/user-interaction/enums/AttributeNames.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* eslint-disable header/header */
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export enum AttributeNames {
EVENT_TYPE = 'event_type',
TARGET_ELEMENT = 'target_element',
TARGET_XPATH = 'target_xpath',
HTTP_URL = 'http.url',
}
Loading

0 comments on commit f462003

Please sign in to comment.