Skip to content

Commit 42bfa43

Browse files
committed
rebase and add back instrumentation with suggested changes
1 parent 6fbbd6c commit 42bfa43

26 files changed

+7097
-9619
lines changed

.github/component-label-map.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ pkg:propagator-aws-xray-lambda:
287287
- changed-files:
288288
- any-glob-to-any-file:
289289
- packages/propagator-aws-xray-lambda/**
290+
pkg:instrumentation-browser-navigation:
291+
- changed-files:
292+
- any-glob-to-any-file:
293+
- packages/instrumentation-browser-navigation/**
290294
pkg-status:unmaintained:
291295
- changed-files:
292296
- any-glob-to-any-file:

.github/component_owners.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ components:
158158
- obecny
159159
packages/plugin-react-load:
160160
- martinkuba
161+
packages/instrumentation-browser-navigation:
162+
- Abinet18
163+
- martinkuba
161164
packages/propagator-instana:
162165
- kirrg001
163166
packages/propagator-ot-trace: []
@@ -166,6 +169,5 @@ components:
166169
- jj22ee
167170
packages/propagator-aws-xray-lambda: [ ]
168171
# Unmaintained
169-
170172
ignored-authors:
171173
- renovate-bot

.release-please-manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@
6666
"packages/propagator-instana": "0.4.3",
6767
"packages/propagator-ot-trace": "0.28.3",
6868
"packages/propagator-aws-xray": "2.1.3",
69-
"packages/propagator-aws-xray-lambda": "0.55.3"
69+
"packages/propagator-aws-xray-lambda": "0.55.3",
70+
"packages/instrumentation-browser-navigation": "0.39.0"
7071
}

examples/web/examples/document-load/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
<script type="text/javascript" src="document-load.js"></script>
2626
<br/>
2727
<button id="button1">Test WebTracer with ZoneContextManager - async</button>
28+
<nav>
29+
<a href="document-load/route1" data-link>Route 1</a>
30+
<a href="document-load/route2" data-link>Route 2</a>
31+
</nav>
32+
33+
<div id="content">
34+
<!-- Content will be loaded here -->
35+
</div>
2836

2937
</body>
3038

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<title>Browser Navigation Instrumentation Example</title>
7+
<base href="/">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
</head>
10+
11+
<body>
12+
<h1>🧭 Browser Navigation Instrumentation Example</h1>
13+
<p>This example demonstrates the <strong>Browser Navigation Instrumentation</strong> package with enhanced Navigation API support, custom log record data, and comprehensive event tracking.</p>
14+
15+
<div class="info-panel">
16+
<h3>📊 Features Demonstrated:</h3>
17+
<ul>
18+
<li><strong>Navigation API Support:</strong> Modern browser navigation events</li>
19+
<li><strong>History API Tracking:</strong> pushState, replaceState, popstate events</li>
20+
<li><strong>Hash Change Detection:</strong> Fragment navigation tracking</li>
21+
<li><strong>Custom Log Attributes:</strong> Custom attribute injection</li>
22+
<li><strong>URL Sanitization:</strong> Automatic credential and sensitive data redaction</li>
23+
<li><strong>Same-Document Navigation:</strong> SPA-style navigation detection</li>
24+
</ul>
25+
</div>
26+
27+
<script type="text/javascript" src="/navigation.js"></script>
28+
<nav>
29+
<a href="/navigation/route1" data-link>Route 1</a>
30+
<a href="/navigation/route2" data-link>Route 2</a>
31+
<button id="hashChangeBtn">Test Hash Change</button>
32+
<button id="backBtn">Go Back</button>
33+
<button id="navApiHashBtn">Nav API: Hash</button>
34+
</nav>
35+
36+
<div id="content">
37+
<!-- Content will be loaded here -->
38+
</div>
39+
40+
<div id="hash-content">
41+
<!-- Hash content will be displayed here -->
42+
</div>
43+
44+
<div id="nav-api-content">
45+
<!-- Navigation API content will be displayed here -->
46+
</div>
47+
48+
<style>
49+
.nav-result {
50+
margin: 10px 0;
51+
padding: 15px;
52+
border-radius: 8px;
53+
border-left: 4px solid #007acc;
54+
background-color: #f8f9fa;
55+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
56+
}
57+
.nav-result.error {
58+
border-left-color: #dc3545;
59+
background-color: #f8d7da;
60+
}
61+
.nav-result.fallback {
62+
border-left-color: #ffc107;
63+
background-color: #fff3cd;
64+
}
65+
.nav-result h4 {
66+
margin: 0 0 10px 0;
67+
color: #333;
68+
}
69+
.nav-result code {
70+
background-color: #e9ecef;
71+
padding: 2px 6px;
72+
border-radius: 4px;
73+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
74+
}
75+
.nav-result ul {
76+
margin: 10px 0;
77+
padding-left: 20px;
78+
}
79+
.nav-result li {
80+
margin: 5px 0;
81+
}
82+
.console-note {
83+
font-style: italic;
84+
color: #6c757d;
85+
margin-top: 10px;
86+
}
87+
.info-panel {
88+
margin: 20px 0;
89+
padding: 15px;
90+
background-color: #e8f4fd;
91+
border-radius: 8px;
92+
border-left: 4px solid #007acc;
93+
}
94+
.info-panel h3 {
95+
margin-top: 0;
96+
color: #007acc;
97+
}
98+
.info-panel ul {
99+
margin: 10px 0;
100+
padding-left: 20px;
101+
}
102+
.info-panel li {
103+
margin: 8px 0;
104+
}
105+
nav {
106+
margin: 20px 0;
107+
padding: 15px;
108+
background-color: #f1f3f4;
109+
border-radius: 8px;
110+
}
111+
nav a, nav button {
112+
margin: 5px 10px 5px 0;
113+
padding: 8px 16px;
114+
text-decoration: none;
115+
background-color: #007acc;
116+
color: white;
117+
border: none;
118+
border-radius: 4px;
119+
cursor: pointer;
120+
font-size: 14px;
121+
}
122+
nav a:hover, nav button:hover {
123+
background-color: #005a9e;
124+
}
125+
body {
126+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
127+
line-height: 1.6;
128+
margin: 20px;
129+
color: #333;
130+
}
131+
h1 {
132+
color: #007acc;
133+
border-bottom: 2px solid #007acc;
134+
padding-bottom: 10px;
135+
}
136+
</style>
137+
138+
</body>
139+
140+
</html>

0 commit comments

Comments
 (0)