From 9ef7a8ac17d33184c6abdee4d9f344def7e4b93f Mon Sep 17 00:00:00 2001
From: Abinet Debele
Date: Fri, 10 Oct 2025 10:08:48 -0700
Subject: [PATCH 1/2] Rebase and add browser navigation instrumentation
---
.github/component-label-map.yml | 4 +
.github/component_owners.yml | 4 +-
.release-please-manifest.json | 3 +-
.../web/examples/document-load/index.html | 8 +
examples/web/examples/navigation/index.html | 140 +
examples/web/examples/navigation/index.js | 242 +
examples/web/package.json | 19 +-
examples/web/webpack.config.js | 43 +-
karma.webpack.js | 6 +
package-lock.json | 13526 +++++-----------
.../.eslintignore | 1 +
.../.eslintrc.js | 24 +
.../LICENSE | 201 +
.../README.md | 92 +
.../karma.conf.js | 25 +
.../package.json | 77 +
.../src/index.ts | 18 +
.../src/instrumentation.ts | 398 +
.../src/types.ts | 35 +
.../test/index-webpack.ts | 20 +
.../test/navigation.test.ts | 589 +
.../tsconfig.esm.json | 11 +
.../tsconfig.esnext.json | 11 +
.../tsconfig.json | 11 +
.../web-test-runner.config.mjs | 45 +
release-please-config.json | 3 +-
26 files changed, 6003 insertions(+), 9553 deletions(-)
create mode 100644 examples/web/examples/navigation/index.html
create mode 100644 examples/web/examples/navigation/index.js
create mode 100644 packages/instrumentation-browser-navigation/.eslintignore
create mode 100644 packages/instrumentation-browser-navigation/.eslintrc.js
create mode 100644 packages/instrumentation-browser-navigation/LICENSE
create mode 100644 packages/instrumentation-browser-navigation/README.md
create mode 100644 packages/instrumentation-browser-navigation/karma.conf.js
create mode 100644 packages/instrumentation-browser-navigation/package.json
create mode 100644 packages/instrumentation-browser-navigation/src/index.ts
create mode 100644 packages/instrumentation-browser-navigation/src/instrumentation.ts
create mode 100644 packages/instrumentation-browser-navigation/src/types.ts
create mode 100644 packages/instrumentation-browser-navigation/test/index-webpack.ts
create mode 100644 packages/instrumentation-browser-navigation/test/navigation.test.ts
create mode 100644 packages/instrumentation-browser-navigation/tsconfig.esm.json
create mode 100644 packages/instrumentation-browser-navigation/tsconfig.esnext.json
create mode 100644 packages/instrumentation-browser-navigation/tsconfig.json
create mode 100644 packages/instrumentation-browser-navigation/web-test-runner.config.mjs
diff --git a/.github/component-label-map.yml b/.github/component-label-map.yml
index b25b55e78c..c1d1fd9e78 100644
--- a/.github/component-label-map.yml
+++ b/.github/component-label-map.yml
@@ -287,6 +287,10 @@ pkg:propagator-aws-xray-lambda:
- changed-files:
- any-glob-to-any-file:
- packages/propagator-aws-xray-lambda/**
+pkg:instrumentation-browser-navigation:
+ - changed-files:
+ - any-glob-to-any-file:
+ - packages/instrumentation-browser-navigation/**
pkg-status:unmaintained:
- changed-files:
- any-glob-to-any-file:
diff --git a/.github/component_owners.yml b/.github/component_owners.yml
index 85120136a8..f14bda4e05 100644
--- a/.github/component_owners.yml
+++ b/.github/component_owners.yml
@@ -158,6 +158,9 @@ components:
- obecny
packages/plugin-react-load:
- martinkuba
+ packages/instrumentation-browser-navigation:
+ - Abinet18
+ - martinkuba
packages/propagator-instana:
- kirrg001
packages/propagator-ot-trace: []
@@ -166,6 +169,5 @@ components:
- jj22ee
packages/propagator-aws-xray-lambda: [ ]
# Unmaintained
-
ignored-authors:
- renovate-bot
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index c85dd2d8d1..7b70e1671e 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -66,5 +66,6 @@
"packages/propagator-instana": "0.4.3",
"packages/propagator-ot-trace": "0.28.3",
"packages/propagator-aws-xray": "2.1.3",
- "packages/propagator-aws-xray-lambda": "0.55.3"
+ "packages/propagator-aws-xray-lambda": "0.55.3",
+ "packages/instrumentation-browser-navigation": "0.39.0"
}
diff --git a/examples/web/examples/document-load/index.html b/examples/web/examples/document-load/index.html
index b0362bc449..d896513e03 100644
--- a/examples/web/examples/document-load/index.html
+++ b/examples/web/examples/document-load/index.html
@@ -25,6 +25,14 @@
Test WebTracer with ZoneContextManager - async
+
+ Route 1
+ Route 2
+
+
+
+
+
+ 🧭 Browser Navigation Instrumentation Example
+ This example demonstrates the Browser Navigation Instrumentation package with enhanced Navigation API support, custom log record data, and comprehensive event tracking.
+
+
+
📊 Features Demonstrated:
+
+ ✅ Navigation API Support: Modern browser navigation events
+ ✅ History API Tracking: pushState, replaceState, popstate events
+ ✅ Hash Change Detection: Fragment navigation tracking
+ ✅ Custom Log Attributes: Custom attribute injection
+ ✅ URL Sanitization: Automatic credential and sensitive data redaction
+ ✅ Same-Document Navigation: SPA-style navigation detection
+
+
+
+
+
+ Route 1
+ Route 2
+ Test Hash Change
+ Go Back
+ Nav API: Hash
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/web/examples/navigation/index.html b/examples/web/examples/navigation/index.html
new file mode 100644
index 0000000000..760a392337
--- /dev/null
+++ b/examples/web/examples/navigation/index.html
@@ -0,0 +1,140 @@
+
+
+
+