@squide/firefly 13.0.0 → 13.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/AppRouter.js +17 -17
- package/dist/AppRouter.js.map +1 -1
- package/dist/AppRouterContext.js +8 -8
- package/dist/AppRouterContext.js.map +1 -1
- package/dist/AppRouterReducer.js +47 -47
- package/dist/AppRouterReducer.js.map +1 -1
- package/dist/FireflyProvider.js +3 -3
- package/dist/FireflyProvider.js.map +1 -1
- package/dist/FireflyRuntime.js +11 -11
- package/dist/FireflyRuntime.js.map +1 -1
- package/dist/RootRoute.js +10 -10
- package/dist/RootRoute.js.map +1 -1
- package/dist/honeycomb/activeSpan.js +6 -6
- package/dist/honeycomb/activeSpan.js.map +1 -1
- package/dist/honeycomb/canRegisterHoneycombInstrumentation.d.ts +1 -0
- package/dist/honeycomb/canRegisterHoneycombInstrumentation.js +11 -0
- package/dist/honeycomb/canRegisterHoneycombInstrumentation.js.map +1 -0
- package/dist/honeycomb/initializeHoneycomb.d.ts +2 -0
- package/dist/honeycomb/initializeHoneycomb.js +25 -0
- package/dist/honeycomb/initializeHoneycomb.js.map +1 -0
- package/dist/honeycomb/registerHoneycombInstrumentation.d.ts +1 -2
- package/dist/honeycomb/registerHoneycombInstrumentation.js +104 -99
- package/dist/honeycomb/registerHoneycombInstrumentation.js.map +1 -1
- package/dist/honeycomb/tracer.js +2 -2
- package/dist/honeycomb/tracer.js.map +1 -1
- package/dist/honeycomb/utils.js +12 -12
- package/dist/honeycomb/utils.js.map +1 -1
- package/dist/initializeFirefly.js +19 -18
- package/dist/initializeFirefly.js.map +1 -1
- package/dist/useAppRouterStore.js +2 -2
- package/dist/useAppRouterStore.js.map +1 -1
- package/dist/useCanFetchProtectedData.js +2 -2
- package/dist/useCanFetchProtectedData.js.map +1 -1
- package/dist/useCanFetchPublicData.js +2 -2
- package/dist/useCanFetchPublicData.js.map +1 -1
- package/dist/useCanRegisterDeferredRegistrations.js +2 -2
- package/dist/useCanRegisterDeferredRegistrations.js.map +1 -1
- package/dist/useCanUpdateDeferredRegistrations.js +2 -2
- package/dist/useCanUpdateDeferredRegistrations.js.map +1 -1
- package/dist/useDeferredRegistrations.js +13 -13
- package/dist/useDeferredRegistrations.js.map +1 -1
- package/dist/useExecuteOnce.js +3 -3
- package/dist/useExecuteOnce.js.map +1 -1
- package/dist/useIsActiveRouteProtected.js +5 -5
- package/dist/useIsActiveRouteProtected.js.map +1 -1
- package/dist/useIsBootstrapping.js +2 -2
- package/dist/useIsBootstrapping.js.map +1 -1
- package/dist/useNavigationItems.js +4 -4
- package/dist/useNavigationItems.js.map +1 -1
- package/dist/useProtectedDataHandler.js +4 -4
- package/dist/useProtectedDataHandler.js.map +1 -1
- package/dist/useProtectedDataQueries.js +20 -20
- package/dist/useProtectedDataQueries.js.map +1 -1
- package/dist/usePublicDataHandler.js +4 -4
- package/dist/usePublicDataHandler.js.map +1 -1
- package/dist/usePublicDataQueries.js +19 -19
- package/dist/usePublicDataQueries.js.map +1 -1
- package/dist/useRegisterDeferredRegistrations.js +4 -4
- package/dist/useRegisterDeferredRegistrations.js.map +1 -1
- package/dist/useStrictRegistrationMode.js +12 -12
- package/dist/useStrictRegistrationMode.js.map +1 -1
- package/dist/useUpdateDeferredRegistrations.js +6 -6
- package/dist/useUpdateDeferredRegistrations.js.map +1 -1
- package/package.json +16 -21
- package/src/honeycomb/canRegisterHoneycombInstrumentation.ts +5 -0
- package/src/honeycomb/initializeHoneycomb.ts +22 -0
- package/src/honeycomb/registerHoneycombInstrumentation.ts +43 -50
- package/src/initializeFirefly.ts +12 -9
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { LocalModuleDeferredRegistrationFailedEvent, LocalModuleDeferredRegistrationUpdateFailedEvent, LocalModuleRegistrationFailedEvent, LocalModulesDeferredRegistrationCompletedEvent, LocalModulesDeferredRegistrationStartedEvent, LocalModulesDeferredRegistrationsUpdateCompletedEvent, LocalModulesDeferredRegistrationsUpdateStartedEvent, LocalModulesRegistrationCompletedEvent, LocalModulesRegistrationStartedEvent } from "@squide/core";
|
|
2
|
+
import { DeferredRegistrationsUpdateCompletedEvent, DeferredRegistrationsUpdateStartedEvent, RemoteModuleDeferredRegistrationFailedEvent, RemoteModuleDeferredRegistrationUpdateFailedEvent, RemoteModuleRegistrationFailedEvent, RemoteModulesDeferredRegistrationCompletedEvent, RemoteModulesDeferredRegistrationStartedEvent, RemoteModulesDeferredRegistrationsUpdateCompletedEvent, RemoteModulesDeferredRegistrationsUpdateStartedEvent, RemoteModulesRegistrationCompletedEvent, RemoteModulesRegistrationStartedEvent } from "@squide/module-federation";
|
|
3
|
+
import { ApplicationBoostrappedEvent, ModulesReadyEvent, ModulesRegisteredEvent, MswReadyEvent, ProtectedDataReadyEvent, PublicDataReadyEvent } from "../AppRouterReducer.js";
|
|
4
|
+
import { ApplicationBootstrappingStartedEvent } from "../initializeFirefly.js";
|
|
5
|
+
import { ProtectedDataFetchFailedEvent, ProtectedDataFetchStartedEvent } from "../useProtectedDataQueries.js";
|
|
6
|
+
import { PublicDataFetchFailedEvent, PublicDataFetchStartedEvent } from "../usePublicDataQueries.js";
|
|
7
|
+
import { createOverrideFetchRequestSpanWithActiveSpanContext, registerActiveSpanStack } from "./activeSpan.js";
|
|
8
|
+
import { getTracer } from "./tracer.js";
|
|
9
|
+
import { endActiveSpan, startActiveChildSpan, startChildSpan, startSpan, traceError } from "./utils.js";
|
|
10
10
|
|
|
11
11
|
;// CONCATENATED MODULE: external "@squide/core"
|
|
12
12
|
|
|
@@ -36,18 +36,18 @@ import * as __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__ from "./utils.js";
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
function reduceDataFetchEvents(runtime,
|
|
39
|
+
function reduceDataFetchEvents(runtime, onDataFetchStarted, onDataReady, onPublicDataFetchStarted, onPublicDataReady, onProtectedDataFetchStarted, onProtectedDataReady, onDataFetchFailed) {
|
|
40
40
|
let dataFetchState = "none";
|
|
41
|
-
|
|
42
|
-
runtime.eventBus.addListener(__WEBPACK_EXTERNAL_MODULE__usePublicDataQueries_js_1f22e760__.PublicDataFetchStartedEvent, ()=>{
|
|
41
|
+
runtime.eventBus.addListener(PublicDataFetchStartedEvent, ()=>{
|
|
43
42
|
if (dataFetchState === "none") {
|
|
44
43
|
dataFetchState = "fetching-data";
|
|
45
|
-
|
|
44
|
+
onDataFetchStarted();
|
|
46
45
|
}
|
|
47
46
|
onPublicDataFetchStarted();
|
|
47
|
+
}, {
|
|
48
|
+
once: true
|
|
48
49
|
});
|
|
49
|
-
|
|
50
|
-
runtime.eventBus.addListener(__WEBPACK_EXTERNAL_MODULE__AppRouterReducer_js_9236b353__.PublicDataReadyEvent, ()=>{
|
|
50
|
+
runtime.eventBus.addListener(PublicDataReadyEvent, ()=>{
|
|
51
51
|
onPublicDataReady();
|
|
52
52
|
if (dataFetchState === "fetching-data") {
|
|
53
53
|
dataFetchState = "public-data-ready";
|
|
@@ -55,17 +55,19 @@ function reduceDataFetchEvents(runtime, onDataFetchingStarted, onDataReady, onPu
|
|
|
55
55
|
dataFetchState = "data-ready";
|
|
56
56
|
onDataReady();
|
|
57
57
|
}
|
|
58
|
+
}, {
|
|
59
|
+
once: true
|
|
58
60
|
});
|
|
59
|
-
|
|
60
|
-
runtime.eventBus.addListener(__WEBPACK_EXTERNAL_MODULE__useProtectedDataQueries_js_5ede0a53__.ProtectedDataFetchStartedEvent, ()=>{
|
|
61
|
+
runtime.eventBus.addListener(ProtectedDataFetchStartedEvent, ()=>{
|
|
61
62
|
if (dataFetchState === "none") {
|
|
62
63
|
dataFetchState = "fetching-data";
|
|
63
|
-
|
|
64
|
+
onDataFetchStarted();
|
|
64
65
|
}
|
|
65
66
|
onProtectedDataFetchStarted();
|
|
67
|
+
}, {
|
|
68
|
+
once: true
|
|
66
69
|
});
|
|
67
|
-
|
|
68
|
-
runtime.eventBus.addListener(__WEBPACK_EXTERNAL_MODULE__AppRouterReducer_js_9236b353__.ProtectedDataReadyEvent, ()=>{
|
|
70
|
+
runtime.eventBus.addListener(ProtectedDataReadyEvent, ()=>{
|
|
69
71
|
onProtectedDataReady();
|
|
70
72
|
if (dataFetchState === "fetching-data") {
|
|
71
73
|
dataFetchState = "protected-data-ready";
|
|
@@ -73,6 +75,20 @@ function reduceDataFetchEvents(runtime, onDataFetchingStarted, onDataReady, onPu
|
|
|
73
75
|
dataFetchState = "data-ready";
|
|
74
76
|
onDataReady();
|
|
75
77
|
}
|
|
78
|
+
}, {
|
|
79
|
+
once: true
|
|
80
|
+
});
|
|
81
|
+
const handleDataFetchFailed = (payload)=>{
|
|
82
|
+
if (dataFetchState !== "data-fetch-failed") {
|
|
83
|
+
dataFetchState = "data-fetch-failed";
|
|
84
|
+
onDataFetchFailed(payload);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
runtime.eventBus.addListener(PublicDataFetchFailedEvent, handleDataFetchFailed, {
|
|
88
|
+
once: true
|
|
89
|
+
});
|
|
90
|
+
runtime.eventBus.addListener(ProtectedDataFetchFailedEvent, handleDataFetchFailed, {
|
|
91
|
+
once: true
|
|
76
92
|
});
|
|
77
93
|
}
|
|
78
94
|
function registerTrackingListeners(runtime) {
|
|
@@ -85,34 +101,34 @@ function registerTrackingListeners(runtime) {
|
|
|
85
101
|
let deferredRegistrationsUpdateSpan;
|
|
86
102
|
let localModuleDeferredRegistrationsUpdateSpan;
|
|
87
103
|
let remoteModuleDeferredRegistrationsUpdateSpan;
|
|
88
|
-
runtime.eventBus.addListener(
|
|
89
|
-
bootstrappingSpan =
|
|
104
|
+
runtime.eventBus.addListener(ApplicationBootstrappingStartedEvent, ()=>{
|
|
105
|
+
bootstrappingSpan = startSpan((options, context)=>getTracer().startSpan("squide-bootstrapping", options, context));
|
|
90
106
|
}, {
|
|
91
107
|
once: true
|
|
92
108
|
});
|
|
93
|
-
runtime.eventBus.addListener(
|
|
109
|
+
runtime.eventBus.addListener(ApplicationBoostrappedEvent, ()=>{
|
|
94
110
|
if (bootstrappingSpan) {
|
|
95
111
|
bootstrappingSpan.end();
|
|
96
112
|
}
|
|
97
113
|
}, {
|
|
98
114
|
once: true
|
|
99
115
|
});
|
|
100
|
-
runtime.eventBus.addListener(
|
|
116
|
+
runtime.eventBus.addListener(MswReadyEvent, ()=>{
|
|
101
117
|
if (bootstrappingSpan) {
|
|
102
118
|
bootstrappingSpan.addEvent("msw-ready");
|
|
103
119
|
}
|
|
104
120
|
}, {
|
|
105
121
|
once: true
|
|
106
122
|
});
|
|
107
|
-
runtime.eventBus.addListener(
|
|
123
|
+
runtime.eventBus.addListener(LocalModulesRegistrationStartedEvent, (payload)=>{
|
|
108
124
|
const attributes = {
|
|
109
125
|
"app.squide.module_count": payload.moduleCount
|
|
110
126
|
};
|
|
111
127
|
if (bootstrappingSpan) {
|
|
112
128
|
bootstrappingSpan.addEvent("local-module-registration-started", attributes);
|
|
113
129
|
}
|
|
114
|
-
localModuleRegistrationSpan =
|
|
115
|
-
return
|
|
130
|
+
localModuleRegistrationSpan = startChildSpan(bootstrappingSpan, (options, context)=>{
|
|
131
|
+
return getTracer().startSpan("local-module-registration", {
|
|
116
132
|
...options,
|
|
117
133
|
attributes
|
|
118
134
|
}, context);
|
|
@@ -120,7 +136,7 @@ function registerTrackingListeners(runtime) {
|
|
|
120
136
|
}, {
|
|
121
137
|
once: true
|
|
122
138
|
});
|
|
123
|
-
runtime.eventBus.addListener(
|
|
139
|
+
runtime.eventBus.addListener(LocalModulesRegistrationCompletedEvent, (payload)=>{
|
|
124
140
|
if (bootstrappingSpan) {
|
|
125
141
|
bootstrappingSpan.addEvent("local-module-registration-completed", {
|
|
126
142
|
"app.squide.module_count": payload.moduleCount
|
|
@@ -133,21 +149,21 @@ function registerTrackingListeners(runtime) {
|
|
|
133
149
|
once: true
|
|
134
150
|
});
|
|
135
151
|
// Can occur multiple times.
|
|
136
|
-
runtime.eventBus.addListener(
|
|
152
|
+
runtime.eventBus.addListener(LocalModuleRegistrationFailedEvent, (payload)=>{
|
|
137
153
|
const registrationError = payload;
|
|
138
154
|
if (localModuleRegistrationSpan) {
|
|
139
|
-
|
|
155
|
+
traceError(localModuleRegistrationSpan, registrationError);
|
|
140
156
|
}
|
|
141
157
|
});
|
|
142
|
-
runtime.eventBus.addListener(
|
|
158
|
+
runtime.eventBus.addListener(LocalModulesDeferredRegistrationStartedEvent, (payload)=>{
|
|
143
159
|
const attributes = {
|
|
144
160
|
"app.squide.registration_count": payload.registrationCount
|
|
145
161
|
};
|
|
146
162
|
if (bootstrappingSpan) {
|
|
147
163
|
bootstrappingSpan.addEvent("local-module-deferred-registration-started", attributes);
|
|
148
164
|
}
|
|
149
|
-
localModuleDeferredRegistrationSpan =
|
|
150
|
-
return
|
|
165
|
+
localModuleDeferredRegistrationSpan = startChildSpan(bootstrappingSpan, (options, context)=>{
|
|
166
|
+
return getTracer().startSpan("local-module-deferred-registration", {
|
|
151
167
|
...options,
|
|
152
168
|
attributes
|
|
153
169
|
}, context);
|
|
@@ -155,7 +171,7 @@ function registerTrackingListeners(runtime) {
|
|
|
155
171
|
}, {
|
|
156
172
|
once: true
|
|
157
173
|
});
|
|
158
|
-
runtime.eventBus.addListener(
|
|
174
|
+
runtime.eventBus.addListener(LocalModulesDeferredRegistrationCompletedEvent, (payload)=>{
|
|
159
175
|
if (bootstrappingSpan) {
|
|
160
176
|
bootstrappingSpan.addEvent("local-module-deferred-registration-completed", {
|
|
161
177
|
"app.squide.registration_count": payload.registrationCount
|
|
@@ -168,21 +184,21 @@ function registerTrackingListeners(runtime) {
|
|
|
168
184
|
once: true
|
|
169
185
|
});
|
|
170
186
|
// Can occur multiple times.
|
|
171
|
-
runtime.eventBus.addListener(
|
|
187
|
+
runtime.eventBus.addListener(LocalModuleDeferredRegistrationFailedEvent, (payload)=>{
|
|
172
188
|
const registrationError = payload;
|
|
173
189
|
if (localModuleDeferredRegistrationSpan) {
|
|
174
|
-
|
|
190
|
+
traceError(localModuleRegistrationSpan, registrationError);
|
|
175
191
|
}
|
|
176
192
|
});
|
|
177
|
-
runtime.eventBus.addListener(
|
|
193
|
+
runtime.eventBus.addListener(RemoteModulesRegistrationStartedEvent, (payload)=>{
|
|
178
194
|
const attributes = {
|
|
179
195
|
"app.squide.remote_count": payload.remoteCount
|
|
180
196
|
};
|
|
181
197
|
if (bootstrappingSpan) {
|
|
182
198
|
bootstrappingSpan.addEvent("remote-module-registration-started", attributes);
|
|
183
199
|
}
|
|
184
|
-
remoteModuleRegistrationSpan =
|
|
185
|
-
return
|
|
200
|
+
remoteModuleRegistrationSpan = startChildSpan(bootstrappingSpan, (options, context)=>{
|
|
201
|
+
return getTracer().startSpan("remote-module-registration", {
|
|
186
202
|
...options,
|
|
187
203
|
attributes
|
|
188
204
|
}, context);
|
|
@@ -190,7 +206,7 @@ function registerTrackingListeners(runtime) {
|
|
|
190
206
|
}, {
|
|
191
207
|
once: true
|
|
192
208
|
});
|
|
193
|
-
runtime.eventBus.addListener(
|
|
209
|
+
runtime.eventBus.addListener(RemoteModulesRegistrationCompletedEvent, (payload)=>{
|
|
194
210
|
if (bootstrappingSpan) {
|
|
195
211
|
bootstrappingSpan.addEvent("remote-module-registration-completed", {
|
|
196
212
|
"app.squide.remote_count": payload.remoteCount
|
|
@@ -203,21 +219,21 @@ function registerTrackingListeners(runtime) {
|
|
|
203
219
|
once: true
|
|
204
220
|
});
|
|
205
221
|
// Can occur multiple times.
|
|
206
|
-
runtime.eventBus.addListener(
|
|
222
|
+
runtime.eventBus.addListener(RemoteModuleRegistrationFailedEvent, (payload)=>{
|
|
207
223
|
const registrationError = payload;
|
|
208
224
|
if (remoteModuleRegistrationSpan) {
|
|
209
|
-
|
|
225
|
+
traceError(remoteModuleRegistrationSpan, registrationError);
|
|
210
226
|
}
|
|
211
227
|
});
|
|
212
|
-
runtime.eventBus.addListener(
|
|
228
|
+
runtime.eventBus.addListener(RemoteModulesDeferredRegistrationStartedEvent, (payload)=>{
|
|
213
229
|
const attributes = {
|
|
214
230
|
"app.squide.registration_count": payload.registrationCount
|
|
215
231
|
};
|
|
216
232
|
if (bootstrappingSpan) {
|
|
217
233
|
bootstrappingSpan.addEvent("remote-module-deferred-registration-started", attributes);
|
|
218
234
|
}
|
|
219
|
-
remoteModuleDeferredRegistrationSpan =
|
|
220
|
-
return
|
|
235
|
+
remoteModuleDeferredRegistrationSpan = startChildSpan(bootstrappingSpan, (options, context)=>{
|
|
236
|
+
return getTracer().startSpan("remote-module-deferred-registration", {
|
|
221
237
|
...options,
|
|
222
238
|
attributes
|
|
223
239
|
}, context);
|
|
@@ -225,7 +241,7 @@ function registerTrackingListeners(runtime) {
|
|
|
225
241
|
}, {
|
|
226
242
|
once: true
|
|
227
243
|
});
|
|
228
|
-
runtime.eventBus.addListener(
|
|
244
|
+
runtime.eventBus.addListener(RemoteModulesDeferredRegistrationCompletedEvent, (payload)=>{
|
|
229
245
|
if (bootstrappingSpan) {
|
|
230
246
|
bootstrappingSpan.addEvent("remote-module-deferred-registration-completed", {
|
|
231
247
|
"app.squide.registration_count": payload.registrationCount
|
|
@@ -238,16 +254,16 @@ function registerTrackingListeners(runtime) {
|
|
|
238
254
|
once: true
|
|
239
255
|
});
|
|
240
256
|
// Can occur multiple times.
|
|
241
|
-
runtime.eventBus.addListener(
|
|
257
|
+
runtime.eventBus.addListener(RemoteModuleDeferredRegistrationFailedEvent, (payload)=>{
|
|
242
258
|
const registrationError = payload;
|
|
243
259
|
if (remoteModuleDeferredRegistrationSpan) {
|
|
244
|
-
|
|
260
|
+
traceError(remoteModuleDeferredRegistrationSpan, registrationError);
|
|
245
261
|
}
|
|
246
262
|
});
|
|
247
263
|
const handleFetchDataStarted = ()=>{
|
|
248
|
-
dataFetchSpan =
|
|
264
|
+
dataFetchSpan = startActiveChildSpan(bootstrappingSpan, (options, context)=>{
|
|
249
265
|
const name = "data-fetch";
|
|
250
|
-
const span =
|
|
266
|
+
const span = getTracer().startSpan(name, options, context);
|
|
251
267
|
return {
|
|
252
268
|
name,
|
|
253
269
|
span
|
|
@@ -256,7 +272,7 @@ function registerTrackingListeners(runtime) {
|
|
|
256
272
|
};
|
|
257
273
|
const handleDataReady = ()=>{
|
|
258
274
|
if (dataFetchSpan) {
|
|
259
|
-
|
|
275
|
+
endActiveSpan(dataFetchSpan);
|
|
260
276
|
}
|
|
261
277
|
};
|
|
262
278
|
const handlePublicDataFetchStarted = ()=>{
|
|
@@ -279,15 +295,29 @@ function registerTrackingListeners(runtime) {
|
|
|
279
295
|
dataFetchSpan.instance.addEvent("protected-data-ready");
|
|
280
296
|
}
|
|
281
297
|
};
|
|
282
|
-
|
|
283
|
-
|
|
298
|
+
const handleDataFetchFailed = (queriesErrors)=>{
|
|
299
|
+
if (dataFetchSpan) {
|
|
300
|
+
queriesErrors.forEach((x)=>{
|
|
301
|
+
traceError(dataFetchSpan.instance, x);
|
|
302
|
+
});
|
|
303
|
+
dataFetchSpan.instance.end();
|
|
304
|
+
}
|
|
305
|
+
if (bootstrappingSpan) {
|
|
306
|
+
queriesErrors.forEach((x)=>{
|
|
307
|
+
traceError(bootstrappingSpan, x);
|
|
308
|
+
});
|
|
309
|
+
bootstrappingSpan.end();
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
reduceDataFetchEvents(runtime, handleFetchDataStarted, handleDataReady, handlePublicDataFetchStarted, handlePublicDataReady, handleProtectedDataFetchStarted, handleProtectedDataReady, handleDataFetchFailed);
|
|
313
|
+
runtime.eventBus.addListener(ModulesRegisteredEvent, ()=>{
|
|
284
314
|
if (bootstrappingSpan) {
|
|
285
315
|
bootstrappingSpan.addEvent("modules-registered");
|
|
286
316
|
}
|
|
287
317
|
}, {
|
|
288
318
|
once: true
|
|
289
319
|
});
|
|
290
|
-
runtime.eventBus.addListener(
|
|
320
|
+
runtime.eventBus.addListener(ModulesReadyEvent, ()=>{
|
|
291
321
|
if (bootstrappingSpan) {
|
|
292
322
|
bootstrappingSpan.addEvent("modules-ready");
|
|
293
323
|
}
|
|
@@ -295,26 +325,26 @@ function registerTrackingListeners(runtime) {
|
|
|
295
325
|
once: true
|
|
296
326
|
});
|
|
297
327
|
// Can occur multiple times.
|
|
298
|
-
runtime.eventBus.addListener(
|
|
299
|
-
deferredRegistrationsUpdateSpan =
|
|
328
|
+
runtime.eventBus.addListener(DeferredRegistrationsUpdateStartedEvent, ()=>{
|
|
329
|
+
deferredRegistrationsUpdateSpan = startSpan((options, context)=>getTracer().startSpan("squide-deferred-registrations-update", options, context));
|
|
300
330
|
});
|
|
301
331
|
// Can occur multiple times.
|
|
302
|
-
runtime.eventBus.addListener(
|
|
332
|
+
runtime.eventBus.addListener(DeferredRegistrationsUpdateCompletedEvent, ()=>{
|
|
303
333
|
if (deferredRegistrationsUpdateSpan) {
|
|
304
334
|
deferredRegistrationsUpdateSpan.end();
|
|
305
335
|
}
|
|
306
336
|
});
|
|
307
337
|
// Can occur multiple times.
|
|
308
|
-
runtime.eventBus.addListener(
|
|
338
|
+
runtime.eventBus.addListener(LocalModulesDeferredRegistrationsUpdateStartedEvent, (payload)=>{
|
|
309
339
|
const attributes = {
|
|
310
340
|
"app.squide.registration_count": payload.registrationCount
|
|
311
341
|
};
|
|
312
342
|
if (deferredRegistrationsUpdateSpan) {
|
|
313
343
|
deferredRegistrationsUpdateSpan.addEvent("local-module-deferred-registrations-update-started", attributes);
|
|
314
344
|
}
|
|
315
|
-
localModuleDeferredRegistrationsUpdateSpan =
|
|
345
|
+
localModuleDeferredRegistrationsUpdateSpan = startActiveChildSpan(deferredRegistrationsUpdateSpan, (options, context)=>{
|
|
316
346
|
const name = "local-module-deferred-registrations-update";
|
|
317
|
-
const span =
|
|
347
|
+
const span = getTracer().startSpan(name, {
|
|
318
348
|
attributes,
|
|
319
349
|
...options
|
|
320
350
|
}, context);
|
|
@@ -325,34 +355,34 @@ function registerTrackingListeners(runtime) {
|
|
|
325
355
|
});
|
|
326
356
|
});
|
|
327
357
|
// Can occur multiple times.
|
|
328
|
-
runtime.eventBus.addListener(
|
|
358
|
+
runtime.eventBus.addListener(LocalModulesDeferredRegistrationsUpdateCompletedEvent, (payload)=>{
|
|
329
359
|
if (deferredRegistrationsUpdateSpan) {
|
|
330
360
|
deferredRegistrationsUpdateSpan.addEvent("local-module-deferred-registrations-update-completed", {
|
|
331
361
|
"app.squide.registration_count": payload.registrationCount
|
|
332
362
|
});
|
|
333
363
|
}
|
|
334
364
|
if (localModuleDeferredRegistrationsUpdateSpan) {
|
|
335
|
-
|
|
365
|
+
endActiveSpan(localModuleDeferredRegistrationsUpdateSpan);
|
|
336
366
|
}
|
|
337
367
|
});
|
|
338
368
|
// Can occur multiple times.
|
|
339
|
-
runtime.eventBus.addListener(
|
|
369
|
+
runtime.eventBus.addListener(LocalModuleDeferredRegistrationUpdateFailedEvent, (payload)=>{
|
|
340
370
|
const registrationError = payload;
|
|
341
371
|
if (localModuleDeferredRegistrationsUpdateSpan) {
|
|
342
|
-
|
|
372
|
+
traceError(localModuleDeferredRegistrationsUpdateSpan.instance, registrationError);
|
|
343
373
|
}
|
|
344
374
|
});
|
|
345
375
|
// Can occur multiple times.
|
|
346
|
-
runtime.eventBus.addListener(
|
|
376
|
+
runtime.eventBus.addListener(RemoteModulesDeferredRegistrationsUpdateStartedEvent, (payload)=>{
|
|
347
377
|
const attributes = {
|
|
348
378
|
"app.squide.registration_count": payload.registrationCount
|
|
349
379
|
};
|
|
350
380
|
if (deferredRegistrationsUpdateSpan) {
|
|
351
381
|
deferredRegistrationsUpdateSpan.addEvent("remote-module-deferred-registrations-update-started", attributes);
|
|
352
382
|
}
|
|
353
|
-
remoteModuleDeferredRegistrationsUpdateSpan =
|
|
383
|
+
remoteModuleDeferredRegistrationsUpdateSpan = startActiveChildSpan(deferredRegistrationsUpdateSpan, (options, context)=>{
|
|
354
384
|
const name = "remote-module-deferred-registrations-update";
|
|
355
|
-
const span =
|
|
385
|
+
const span = getTracer().startSpan(name, {
|
|
356
386
|
attributes,
|
|
357
387
|
...options
|
|
358
388
|
}, context);
|
|
@@ -363,21 +393,21 @@ function registerTrackingListeners(runtime) {
|
|
|
363
393
|
});
|
|
364
394
|
});
|
|
365
395
|
// Can occur multiple times.
|
|
366
|
-
runtime.eventBus.addListener(
|
|
396
|
+
runtime.eventBus.addListener(RemoteModulesDeferredRegistrationsUpdateCompletedEvent, (payload)=>{
|
|
367
397
|
if (deferredRegistrationsUpdateSpan) {
|
|
368
398
|
deferredRegistrationsUpdateSpan.addEvent("remote-module-deferred-registrations-update-completed", {
|
|
369
399
|
"app.squide.registration_count": payload.registrationCount
|
|
370
400
|
});
|
|
371
401
|
}
|
|
372
402
|
if (remoteModuleDeferredRegistrationsUpdateSpan) {
|
|
373
|
-
|
|
403
|
+
endActiveSpan(remoteModuleDeferredRegistrationsUpdateSpan);
|
|
374
404
|
}
|
|
375
405
|
});
|
|
376
406
|
// Can occur multiple times.
|
|
377
|
-
runtime.eventBus.addListener(
|
|
407
|
+
runtime.eventBus.addListener(RemoteModuleDeferredRegistrationUpdateFailedEvent, (payload)=>{
|
|
378
408
|
const registrationError = payload;
|
|
379
409
|
if (remoteModuleDeferredRegistrationsUpdateSpan) {
|
|
380
|
-
|
|
410
|
+
traceError(remoteModuleDeferredRegistrationsUpdateSpan.instance, registrationError);
|
|
381
411
|
}
|
|
382
412
|
});
|
|
383
413
|
}
|
|
@@ -389,8 +419,8 @@ function getRegisterFetchRequestHookFunction() {
|
|
|
389
419
|
function registerHoneycombInstrumentation(runtime) {
|
|
390
420
|
const registerFetchRequestHookFunction = getRegisterFetchRequestHookFunction();
|
|
391
421
|
if (registerFetchRequestHookFunction) {
|
|
392
|
-
|
|
393
|
-
const activeSpanOverrideFunction =
|
|
422
|
+
registerActiveSpanStack();
|
|
423
|
+
const activeSpanOverrideFunction = createOverrideFetchRequestSpanWithActiveSpanContext(runtime.logger);
|
|
394
424
|
// Dynamically registering this request hook function to nest the HTTP requests
|
|
395
425
|
// of squide bootstrapping under the appropriate Honeycomb span.
|
|
396
426
|
registerFetchRequestHookFunction(activeSpanOverrideFunction);
|
|
@@ -398,33 +428,8 @@ function registerHoneycombInstrumentation(runtime) {
|
|
|
398
428
|
runtime.logger.warning("[squide] Cannot register Honeycomb fetch request hook because \"globalThis.__WLP_HONEYCOMB_REGISTER_DYNAMIC_FETCH_REQUEST_HOOK\" is not available. Honeycomb instrumentation is still functional but in degraded mode.");
|
|
399
429
|
}
|
|
400
430
|
registerTrackingListeners(runtime);
|
|
401
|
-
// try {
|
|
402
|
-
// const registerFetchRequestHookFunction = getRegisterFetchRequestHookFunction();
|
|
403
|
-
// if (registerFetchRequestHookFunction) {
|
|
404
|
-
// const overrideFetchRequestHook = createOverrideFetchRequestWithManifestSectionSpanContext(runtime.logger);
|
|
405
|
-
// // Dynamically registering this request hook function to nest the HTTP requests
|
|
406
|
-
// // of the widgets initialization under the appropriate Honeycomb span.
|
|
407
|
-
// registerFetchRequestHookFunction(overrideFetchRequestHook);
|
|
408
|
-
// } else {
|
|
409
|
-
// runtime.logger.warning("[wlp-widgets] Cannot register Honeycomb fetch request hook because \"globalThis.__WLP_HONEYCOMB_REGISTER_DYNAMIC_FETCH_REQUEST_HOOK\" is not available. Honeycomb instrumentation is still functional but in degraded mode.");
|
|
410
|
-
// }
|
|
411
|
-
// registerTrackingListeners(runtime);
|
|
412
|
-
// } catch (error: unknown) {
|
|
413
|
-
// runtime.logger.error("[wlp-widgets] An error occured while registering Honeycomb instrumentation.", error);
|
|
414
|
-
// runtime.errorPropagator.propagate(error as Error);
|
|
415
|
-
// }
|
|
416
431
|
}
|
|
417
|
-
function canRegisterHoneycombInstrumentation() {
|
|
418
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
419
|
-
// @ts-ignore
|
|
420
|
-
return globalThis.__WLP_HONEYCOMB_INSTRUMENTATION_IS_REGISTERED__ === true;
|
|
421
|
-
} // export function registerHoneycombInstrumentation(runtime: FireflyRuntime, namespace: string, serviceName: NonNullable<HoneycombSdkOptions["serviceName"]>, apiServiceUrls: PropagateTraceHeaderCorsUrls, options?: RegisterHoneycombInstrumentationOptions) {
|
|
422
|
-
// const augmentedOptions = getInstrumentationOptions(runtime, options);
|
|
423
|
-
// registerWorkleapHoneycombInstrumentation(namespace, serviceName, apiServiceUrls, augmentedOptions);
|
|
424
|
-
// registerTrackingListeners(runtime);
|
|
425
|
-
// registerActiveSpanStack();
|
|
426
|
-
// }
|
|
427
432
|
|
|
428
|
-
export {
|
|
433
|
+
export { reduceDataFetchEvents, registerHoneycombInstrumentation };
|
|
429
434
|
|
|
430
435
|
//# sourceMappingURL=registerHoneycombInstrumentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"honeycomb/registerHoneycombInstrumentation.js","sources":["webpack://@squide/firefly/./src/honeycomb/registerHoneycombInstrumentation.ts"],"sourcesContent":["import type { Span } from \"@opentelemetry/api\";\nimport {\n LocalModuleDeferredRegistrationFailedEvent,\n LocalModuleDeferredRegistrationUpdateFailedEvent,\n LocalModuleRegistrationFailedEvent,\n LocalModulesDeferredRegistrationCompletedEvent,\n type LocalModulesDeferredRegistrationCompletedEventPayload,\n LocalModulesDeferredRegistrationStartedEvent,\n type LocalModulesDeferredRegistrationStartedEventPayload,\n LocalModulesDeferredRegistrationsUpdateCompletedEvent,\n type LocalModulesDeferredRegistrationsUpdateCompletedEventPayload,\n LocalModulesDeferredRegistrationsUpdateStartedEvent,\n type LocalModulesDeferredRegistrationsUpdateStartedEventPayload,\n LocalModulesRegistrationCompletedEvent,\n type LocalModulesRegistrationCompletedEventPayload,\n LocalModulesRegistrationStartedEvent,\n type LocalModulesRegistrationStartedEventPayload,\n type ModuleRegistrationError\n} from \"@squide/core\";\nimport {\n DeferredRegistrationsUpdateCompletedEvent,\n DeferredRegistrationsUpdateStartedEvent,\n RemoteModuleDeferredRegistrationFailedEvent,\n RemoteModuleDeferredRegistrationUpdateFailedEvent,\n type RemoteModuleRegistrationError,\n RemoteModuleRegistrationFailedEvent,\n RemoteModulesDeferredRegistrationCompletedEvent,\n type RemoteModulesDeferredRegistrationCompletedEventPayload,\n RemoteModulesDeferredRegistrationStartedEvent,\n type RemoteModulesDeferredRegistrationStartedEventPayload,\n RemoteModulesDeferredRegistrationsUpdateCompletedEvent,\n type RemoteModulesDeferredRegistrationsUpdateCompletedEventPayload,\n RemoteModulesDeferredRegistrationsUpdateStartedEvent,\n type RemoteModulesDeferredRegistrationsUpdateStartedEventPayload,\n RemoteModulesRegistrationCompletedEvent,\n type RemoteModulesRegistrationCompletedEventPayload,\n RemoteModulesRegistrationStartedEvent,\n type RemoteModulesRegistrationStartedEventPayload\n} from \"@squide/module-federation\";\nimport { ApplicationBoostrappedEvent, ModulesReadyEvent, ModulesRegisteredEvent, MswReadyEvent, ProtectedDataReadyEvent, PublicDataReadyEvent } from \"../AppRouterReducer.ts\";\nimport type { FireflyRuntime } from \"../FireflyRuntime.tsx\";\nimport { ApplicationBootstrappingStartedEvent } from \"../initializeFirefly.ts\";\nimport { ProtectedDataFetchStartedEvent } from \"../useProtectedDataQueries.ts\";\nimport { PublicDataFetchStartedEvent } from \"../usePublicDataQueries.ts\";\nimport { type ActiveSpan, createOverrideFetchRequestSpanWithActiveSpanContext, registerActiveSpanStack } from \"./activeSpan.ts\";\nimport { getTracer } from \"./tracer.ts\";\nimport { endActiveSpan, startActiveChildSpan, startChildSpan, startSpan, traceError } from \"./utils.ts\";\n\n// TIPS:\n// To query those traces in Honeycomb, use the following query filter: \"root.name = squide-bootstrapping\".\n\ntype DataFetchState = \"none\" | \"fetching-data\" | \"public-data-ready\" | \"protected-data-ready\" | \"data-ready\";\n\nexport function reduceDataFetchEvents(\n runtime: FireflyRuntime,\n onDataFetchingStarted: () => void,\n onDataReady: () => void,\n onPublicDataFetchStarted: () => void,\n onPublicDataReady: () => void,\n onProtectedDataFetchStarted: () => void,\n onProtectedDataReady: () => void\n) {\n let dataFetchState: DataFetchState = \"none\";\n\n // TODO: Validate if this handler should use { once: true }.\n runtime.eventBus.addListener(PublicDataFetchStartedEvent, () => {\n if (dataFetchState === \"none\") {\n dataFetchState = \"fetching-data\";\n onDataFetchingStarted();\n }\n\n onPublicDataFetchStarted();\n });\n\n // TODO: Validate if this handler should use { once: true }.\n runtime.eventBus.addListener(PublicDataReadyEvent, () => {\n onPublicDataReady();\n\n if (dataFetchState === \"fetching-data\") {\n dataFetchState = \"public-data-ready\";\n } else if (dataFetchState === \"protected-data-ready\") {\n dataFetchState = \"data-ready\";\n onDataReady();\n }\n });\n\n // TODO: Validate if this handler should use { once: true }.\n runtime.eventBus.addListener(ProtectedDataFetchStartedEvent, () => {\n if (dataFetchState === \"none\") {\n dataFetchState = \"fetching-data\";\n onDataFetchingStarted();\n }\n\n onProtectedDataFetchStarted();\n });\n\n // TODO: Validate if this handler should use { once: true }.\n runtime.eventBus.addListener(ProtectedDataReadyEvent, () => {\n onProtectedDataReady();\n\n if (dataFetchState === \"fetching-data\") {\n dataFetchState = \"protected-data-ready\";\n } else if (dataFetchState === \"public-data-ready\") {\n dataFetchState = \"data-ready\";\n onDataReady();\n }\n });\n}\n\nfunction registerTrackingListeners(runtime: FireflyRuntime) {\n let bootstrappingSpan: Span;\n let localModuleRegistrationSpan: Span;\n let localModuleDeferredRegistrationSpan: Span;\n let remoteModuleRegistrationSpan: Span;\n let remoteModuleDeferredRegistrationSpan: Span;\n let dataFetchSpan: ActiveSpan;\n let deferredRegistrationsUpdateSpan: Span;\n let localModuleDeferredRegistrationsUpdateSpan: ActiveSpan;\n let remoteModuleDeferredRegistrationsUpdateSpan: ActiveSpan;\n\n runtime.eventBus.addListener(ApplicationBootstrappingStartedEvent, () => {\n bootstrappingSpan = startSpan((options, context) => getTracer().startSpan(\"squide-bootstrapping\", options, context));\n }, { once: true });\n\n runtime.eventBus.addListener(ApplicationBoostrappedEvent, () => {\n if (bootstrappingSpan) {\n bootstrappingSpan.end();\n }\n }, { once: true });\n\n runtime.eventBus.addListener(MswReadyEvent, () => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"msw-ready\");\n }\n }, { once: true });\n\n runtime.eventBus.addListener(LocalModulesRegistrationStartedEvent, (payload: unknown) => {\n const attributes = {\n \"app.squide.module_count\": (payload as LocalModulesRegistrationStartedEventPayload).moduleCount\n };\n\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"local-module-registration-started\", attributes);\n }\n\n localModuleRegistrationSpan = startChildSpan(bootstrappingSpan, (options, context) => {\n return getTracer().startSpan(\"local-module-registration\", { ...options, attributes }, context);\n });\n }, { once: true });\n\n runtime.eventBus.addListener(LocalModulesRegistrationCompletedEvent, (payload: unknown) => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"local-module-registration-completed\", {\n \"app.squide.module_count\": (payload as LocalModulesRegistrationCompletedEventPayload).moduleCount\n });\n }\n\n if (localModuleRegistrationSpan) {\n localModuleRegistrationSpan.end();\n }\n }, { once: true });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(LocalModuleRegistrationFailedEvent, (payload: unknown) => {\n const registrationError = payload as ModuleRegistrationError;\n\n if (localModuleRegistrationSpan) {\n traceError(localModuleRegistrationSpan, registrationError);\n }\n });\n\n runtime.eventBus.addListener(LocalModulesDeferredRegistrationStartedEvent, (payload: unknown) => {\n const attributes = {\n \"app.squide.registration_count\": (payload as LocalModulesDeferredRegistrationStartedEventPayload).registrationCount\n };\n\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"local-module-deferred-registration-started\", attributes);\n }\n\n localModuleDeferredRegistrationSpan = startChildSpan(bootstrappingSpan, (options, context) => {\n return getTracer().startSpan(\"local-module-deferred-registration\", { ...options, attributes }, context);\n });\n }, { once: true });\n\n runtime.eventBus.addListener(LocalModulesDeferredRegistrationCompletedEvent, (payload: unknown) => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"local-module-deferred-registration-completed\", {\n \"app.squide.registration_count\": (payload as LocalModulesDeferredRegistrationCompletedEventPayload).registrationCount\n });\n }\n\n if (localModuleDeferredRegistrationSpan) {\n localModuleDeferredRegistrationSpan.end();\n }\n }, { once: true });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(LocalModuleDeferredRegistrationFailedEvent, (payload: unknown) => {\n const registrationError = payload as ModuleRegistrationError;\n\n if (localModuleDeferredRegistrationSpan) {\n traceError(localModuleRegistrationSpan, registrationError);\n }\n });\n\n runtime.eventBus.addListener(RemoteModulesRegistrationStartedEvent, (payload: unknown) => {\n const attributes = {\n \"app.squide.remote_count\": (payload as RemoteModulesRegistrationStartedEventPayload).remoteCount\n };\n\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"remote-module-registration-started\", attributes);\n }\n\n remoteModuleRegistrationSpan = startChildSpan(bootstrappingSpan, (options, context) => {\n return getTracer().startSpan(\"remote-module-registration\", { ...options, attributes }, context);\n });\n }, { once: true });\n\n runtime.eventBus.addListener(RemoteModulesRegistrationCompletedEvent, (payload: unknown) => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"remote-module-registration-completed\", {\n \"app.squide.remote_count\": (payload as RemoteModulesRegistrationCompletedEventPayload).remoteCount\n });\n }\n\n if (remoteModuleRegistrationSpan) {\n remoteModuleRegistrationSpan.end();\n }\n }, { once: true });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(RemoteModuleRegistrationFailedEvent, (payload: unknown) => {\n const registrationError = payload as RemoteModuleRegistrationError;\n\n if (remoteModuleRegistrationSpan) {\n traceError(remoteModuleRegistrationSpan, registrationError);\n }\n });\n\n runtime.eventBus.addListener(RemoteModulesDeferredRegistrationStartedEvent, (payload: unknown) => {\n const attributes = {\n \"app.squide.registration_count\": (payload as RemoteModulesDeferredRegistrationStartedEventPayload).registrationCount\n };\n\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"remote-module-deferred-registration-started\", attributes);\n }\n\n remoteModuleDeferredRegistrationSpan = startChildSpan(bootstrappingSpan, (options, context) => {\n return getTracer().startSpan(\"remote-module-deferred-registration\", { ...options, attributes }, context);\n });\n }, { once: true });\n\n runtime.eventBus.addListener(RemoteModulesDeferredRegistrationCompletedEvent, (payload: unknown) => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"remote-module-deferred-registration-completed\", {\n \"app.squide.registration_count\": (payload as RemoteModulesDeferredRegistrationCompletedEventPayload).registrationCount\n });\n }\n\n if (remoteModuleDeferredRegistrationSpan) {\n remoteModuleDeferredRegistrationSpan.end();\n }\n }, { once: true });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(RemoteModuleDeferredRegistrationFailedEvent, (payload: unknown) => {\n const registrationError = payload as RemoteModuleRegistrationError;\n\n if (remoteModuleDeferredRegistrationSpan) {\n traceError(remoteModuleDeferredRegistrationSpan, registrationError);\n }\n });\n\n const handleFetchDataStarted = () => {\n dataFetchSpan = startActiveChildSpan(bootstrappingSpan, (options, context) => {\n const name = \"data-fetch\";\n const span = getTracer().startSpan(name, options, context);\n\n return {\n name,\n span\n };\n });\n };\n\n const handleDataReady = () => {\n if (dataFetchSpan) {\n endActiveSpan(dataFetchSpan);\n }\n };\n\n const handlePublicDataFetchStarted = () => {\n if (dataFetchSpan) {\n dataFetchSpan.instance.addEvent(\"public-data-fetch-started\");\n }\n };\n\n const handlePublicDataReady = () => {\n if (dataFetchSpan) {\n dataFetchSpan.instance.addEvent(\"public-data-ready\");\n }\n };\n\n const handleProtectedDataFetchStarted = () => {\n if (dataFetchSpan) {\n dataFetchSpan.instance.addEvent(\"protected-data-fetch-started\");\n }\n };\n\n const handleProtectedDataReady = () => {\n if (dataFetchSpan) {\n dataFetchSpan.instance.addEvent(\"protected-data-ready\");\n }\n };\n\n reduceDataFetchEvents(\n runtime,\n handleFetchDataStarted,\n handleDataReady,\n handlePublicDataFetchStarted,\n handlePublicDataReady,\n handleProtectedDataFetchStarted,\n handleProtectedDataReady\n );\n\n runtime.eventBus.addListener(ModulesRegisteredEvent, () => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"modules-registered\");\n }\n }, { once: true });\n\n runtime.eventBus.addListener(ModulesReadyEvent, () => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"modules-ready\");\n }\n }, { once: true });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(DeferredRegistrationsUpdateStartedEvent, () => {\n deferredRegistrationsUpdateSpan = startSpan((options, context) => getTracer().startSpan(\"squide-deferred-registrations-update\", options, context));\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(DeferredRegistrationsUpdateCompletedEvent, () => {\n if (deferredRegistrationsUpdateSpan) {\n deferredRegistrationsUpdateSpan.end();\n }\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(LocalModulesDeferredRegistrationsUpdateStartedEvent, (payload: unknown) => {\n const attributes = {\n \"app.squide.registration_count\": (payload as LocalModulesDeferredRegistrationsUpdateStartedEventPayload).registrationCount\n };\n\n if (deferredRegistrationsUpdateSpan) {\n deferredRegistrationsUpdateSpan.addEvent(\"local-module-deferred-registrations-update-started\", attributes);\n }\n\n localModuleDeferredRegistrationsUpdateSpan = startActiveChildSpan(deferredRegistrationsUpdateSpan, (options, context) => {\n const name = \"local-module-deferred-registrations-update\";\n\n const span = getTracer().startSpan(name, {\n attributes,\n ...options\n }, context);\n\n return {\n name,\n span\n };\n });\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(LocalModulesDeferredRegistrationsUpdateCompletedEvent, (payload: unknown) => {\n if (deferredRegistrationsUpdateSpan) {\n deferredRegistrationsUpdateSpan.addEvent(\"local-module-deferred-registrations-update-completed\", {\n \"app.squide.registration_count\": (payload as LocalModulesDeferredRegistrationsUpdateCompletedEventPayload).registrationCount\n });\n }\n\n if (localModuleDeferredRegistrationsUpdateSpan) {\n endActiveSpan(localModuleDeferredRegistrationsUpdateSpan);\n }\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(LocalModuleDeferredRegistrationUpdateFailedEvent, (payload: unknown) => {\n const registrationError = payload as ModuleRegistrationError;\n\n if (localModuleDeferredRegistrationsUpdateSpan) {\n traceError(localModuleDeferredRegistrationsUpdateSpan.instance, registrationError);\n }\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(RemoteModulesDeferredRegistrationsUpdateStartedEvent, (payload: unknown) => {\n const attributes = {\n \"app.squide.registration_count\": (payload as RemoteModulesDeferredRegistrationsUpdateStartedEventPayload).registrationCount\n };\n\n if (deferredRegistrationsUpdateSpan) {\n deferredRegistrationsUpdateSpan.addEvent(\"remote-module-deferred-registrations-update-started\", attributes);\n }\n\n remoteModuleDeferredRegistrationsUpdateSpan = startActiveChildSpan(deferredRegistrationsUpdateSpan, (options, context) => {\n const name = \"remote-module-deferred-registrations-update\";\n\n const span = getTracer().startSpan(name, {\n attributes,\n ...options\n }, context);\n\n return {\n name,\n span\n };\n });\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(RemoteModulesDeferredRegistrationsUpdateCompletedEvent, (payload: unknown) => {\n if (deferredRegistrationsUpdateSpan) {\n deferredRegistrationsUpdateSpan.addEvent(\"remote-module-deferred-registrations-update-completed\", {\n \"app.squide.registration_count\": (payload as RemoteModulesDeferredRegistrationsUpdateCompletedEventPayload).registrationCount\n });\n }\n\n if (remoteModuleDeferredRegistrationsUpdateSpan) {\n endActiveSpan(remoteModuleDeferredRegistrationsUpdateSpan);\n }\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(RemoteModuleDeferredRegistrationUpdateFailedEvent, (payload: unknown) => {\n const registrationError = payload as RemoteModuleRegistrationError;\n\n if (remoteModuleDeferredRegistrationsUpdateSpan) {\n traceError(remoteModuleDeferredRegistrationsUpdateSpan.instance, registrationError);\n }\n });\n}\n\nfunction getRegisterFetchRequestHookFunction() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return globalThis.__WLP_HONEYCOMB_REGISTER_DYNAMIC_FETCH_REQUEST_HOOK;\n}\n\nexport function registerHoneycombInstrumentation(runtime: FireflyRuntime) {\n const registerFetchRequestHookFunction = getRegisterFetchRequestHookFunction();\n\n if (registerFetchRequestHookFunction) {\n registerActiveSpanStack();\n\n const activeSpanOverrideFunction = createOverrideFetchRequestSpanWithActiveSpanContext(runtime.logger);\n\n // Dynamically registering this request hook function to nest the HTTP requests\n // of squide bootstrapping under the appropriate Honeycomb span.\n registerFetchRequestHookFunction(activeSpanOverrideFunction);\n } else {\n runtime.logger.warning(\"[squide] Cannot register Honeycomb fetch request hook because \\\"globalThis.__WLP_HONEYCOMB_REGISTER_DYNAMIC_FETCH_REQUEST_HOOK\\\" is not available. Honeycomb instrumentation is still functional but in degraded mode.\");\n }\n\n registerTrackingListeners(runtime);\n\n // try {\n // const registerFetchRequestHookFunction = getRegisterFetchRequestHookFunction();\n\n // if (registerFetchRequestHookFunction) {\n // const overrideFetchRequestHook = createOverrideFetchRequestWithManifestSectionSpanContext(runtime.logger);\n\n // // Dynamically registering this request hook function to nest the HTTP requests\n // // of the widgets initialization under the appropriate Honeycomb span.\n // registerFetchRequestHookFunction(overrideFetchRequestHook);\n // } else {\n // runtime.logger.warning(\"[wlp-widgets] Cannot register Honeycomb fetch request hook because \\\"globalThis.__WLP_HONEYCOMB_REGISTER_DYNAMIC_FETCH_REQUEST_HOOK\\\" is not available. Honeycomb instrumentation is still functional but in degraded mode.\");\n // }\n\n // registerTrackingListeners(runtime);\n // } catch (error: unknown) {\n // runtime.logger.error(\"[wlp-widgets] An error occured while registering Honeycomb instrumentation.\", error);\n // runtime.errorPropagator.propagate(error as Error);\n // }\n}\n\nexport function canRegisterHoneycombInstrumentation() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return globalThis.__WLP_HONEYCOMB_INSTRUMENTATION_IS_REGISTERED__ === true;\n}\n\n// export function registerHoneycombInstrumentation(runtime: FireflyRuntime, namespace: string, serviceName: NonNullable<HoneycombSdkOptions[\"serviceName\"]>, apiServiceUrls: PropagateTraceHeaderCorsUrls, options?: RegisterHoneycombInstrumentationOptions) {\n// const augmentedOptions = getInstrumentationOptions(runtime, options);\n\n// registerWorkleapHoneycombInstrumentation(namespace, serviceName, apiServiceUrls, augmentedOptions);\n\n// registerTrackingListeners(runtime);\n// registerActiveSpanStack();\n// }\n"],"names":["LocalModuleDeferredRegistrationFailedEvent","LocalModuleDeferredRegistrationUpdateFailedEvent","LocalModuleRegistrationFailedEvent","LocalModulesDeferredRegistrationCompletedEvent","LocalModulesDeferredRegistrationStartedEvent","LocalModulesDeferredRegistrationsUpdateCompletedEvent","LocalModulesDeferredRegistrationsUpdateStartedEvent","LocalModulesRegistrationCompletedEvent","LocalModulesRegistrationStartedEvent","DeferredRegistrationsUpdateCompletedEvent","DeferredRegistrationsUpdateStartedEvent","RemoteModuleDeferredRegistrationFailedEvent","RemoteModuleDeferredRegistrationUpdateFailedEvent","RemoteModuleRegistrationFailedEvent","RemoteModulesDeferredRegistrationCompletedEvent","RemoteModulesDeferredRegistrationStartedEvent","RemoteModulesDeferredRegistrationsUpdateCompletedEvent","RemoteModulesDeferredRegistrationsUpdateStartedEvent","RemoteModulesRegistrationCompletedEvent","RemoteModulesRegistrationStartedEvent","ApplicationBoostrappedEvent","ModulesReadyEvent","ModulesRegisteredEvent","MswReadyEvent","ProtectedDataReadyEvent","PublicDataReadyEvent","ApplicationBootstrappingStartedEvent","ProtectedDataFetchStartedEvent","PublicDataFetchStartedEvent","createOverrideFetchRequestSpanWithActiveSpanContext","registerActiveSpanStack","getTracer","endActiveSpan","startActiveChildSpan","startChildSpan","startSpan","traceError","reduceDataFetchEvents","runtime","onDataFetchingStarted","onDataReady","onPublicDataFetchStarted","onPublicDataReady","onProtectedDataFetchStarted","onProtectedDataReady","dataFetchState","registerTrackingListeners","bootstrappingSpan","localModuleRegistrationSpan","localModuleDeferredRegistrationSpan","remoteModuleRegistrationSpan","remoteModuleDeferredRegistrationSpan","dataFetchSpan","deferredRegistrationsUpdateSpan","localModuleDeferredRegistrationsUpdateSpan","remoteModuleDeferredRegistrationsUpdateSpan","options","context","payload","attributes","registrationError","handleFetchDataStarted","name","span","handleDataReady","handlePublicDataFetchStarted","handlePublicDataReady","handleProtectedDataFetchStarted","handleProtectedDataReady","getRegisterFetchRequestHookFunction","globalThis","registerHoneycombInstrumentation","registerFetchRequestHookFunction","activeSpanOverrideFunction","canRegisterHoneycombInstrumentation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBsB;AAoBa;AAC2I;AAE/F;AACA;AACN;AACuD;AACxF;AACgE;AAOjG,SAASqC,sBACZC,OAAuB,EACvBC,qBAAiC,EACjCC,WAAuB,EACvBC,wBAAoC,EACpCC,iBAA6B,EAC7BC,2BAAuC,EACvCC,oBAAgC;IAEhC,IAAIC,iBAAiC;IAErC,4DAA4D;IAC5DP,QAAQ,QAAQ,CAAC,WAAW,CAACV,yFAA2BA,EAAE;QACtD,IAAIiB,mBAAmB,QAAQ;YAC3BA,iBAAiB;YACjBN;QACJ;QAEAE;IACJ;IAEA,4DAA4D;IAC5DH,QAAQ,QAAQ,CAAC,WAAW,CAACb,8EAAoBA,EAAE;QAC/CiB;QAEA,IAAIG,mBAAmB,iBAAiB;YACpCA,iBAAiB;QACrB,OAAO,IAAIA,mBAAmB,wBAAwB;YAClDA,iBAAiB;YACjBL;QACJ;IACJ;IAEA,4DAA4D;IAC5DF,QAAQ,QAAQ,CAAC,WAAW,CAACX,+FAA8BA,EAAE;QACzD,IAAIkB,mBAAmB,QAAQ;YAC3BA,iBAAiB;YACjBN;QACJ;QAEAI;IACJ;IAEA,4DAA4D;IAC5DL,QAAQ,QAAQ,CAAC,WAAW,CAACd,iFAAuBA,EAAE;QAClDoB;QAEA,IAAIC,mBAAmB,iBAAiB;YACpCA,iBAAiB;QACrB,OAAO,IAAIA,mBAAmB,qBAAqB;YAC/CA,iBAAiB;YACjBL;QACJ;IACJ;AACJ;AAEA,SAASM,0BAA0BR,OAAuB;IACtD,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,WAAW,+CAA+C,KAAK;AAC1E,EAEA,gQAAgQ;CAChQ,4EAA4E;CAE5E,0GAA0G;CAE1G,0CAA0C;CAC1C,iCAAiC;CACjC,IAAI"}
|
|
1
|
+
{"version":3,"file":"honeycomb/registerHoneycombInstrumentation.js","sources":["webpack://@squide/firefly/./src/honeycomb/registerHoneycombInstrumentation.ts"],"sourcesContent":["import type { Span } from \"@opentelemetry/api\";\nimport {\n LocalModuleDeferredRegistrationFailedEvent,\n LocalModuleDeferredRegistrationUpdateFailedEvent,\n LocalModuleRegistrationFailedEvent,\n LocalModulesDeferredRegistrationCompletedEvent,\n type LocalModulesDeferredRegistrationCompletedEventPayload,\n LocalModulesDeferredRegistrationStartedEvent,\n type LocalModulesDeferredRegistrationStartedEventPayload,\n LocalModulesDeferredRegistrationsUpdateCompletedEvent,\n type LocalModulesDeferredRegistrationsUpdateCompletedEventPayload,\n LocalModulesDeferredRegistrationsUpdateStartedEvent,\n type LocalModulesDeferredRegistrationsUpdateStartedEventPayload,\n LocalModulesRegistrationCompletedEvent,\n type LocalModulesRegistrationCompletedEventPayload,\n LocalModulesRegistrationStartedEvent,\n type LocalModulesRegistrationStartedEventPayload,\n type ModuleRegistrationError\n} from \"@squide/core\";\nimport {\n DeferredRegistrationsUpdateCompletedEvent,\n DeferredRegistrationsUpdateStartedEvent,\n RemoteModuleDeferredRegistrationFailedEvent,\n RemoteModuleDeferredRegistrationUpdateFailedEvent,\n type RemoteModuleRegistrationError,\n RemoteModuleRegistrationFailedEvent,\n RemoteModulesDeferredRegistrationCompletedEvent,\n type RemoteModulesDeferredRegistrationCompletedEventPayload,\n RemoteModulesDeferredRegistrationStartedEvent,\n type RemoteModulesDeferredRegistrationStartedEventPayload,\n RemoteModulesDeferredRegistrationsUpdateCompletedEvent,\n type RemoteModulesDeferredRegistrationsUpdateCompletedEventPayload,\n RemoteModulesDeferredRegistrationsUpdateStartedEvent,\n type RemoteModulesDeferredRegistrationsUpdateStartedEventPayload,\n RemoteModulesRegistrationCompletedEvent,\n type RemoteModulesRegistrationCompletedEventPayload,\n RemoteModulesRegistrationStartedEvent,\n type RemoteModulesRegistrationStartedEventPayload\n} from \"@squide/module-federation\";\nimport { ApplicationBoostrappedEvent, ModulesReadyEvent, ModulesRegisteredEvent, MswReadyEvent, ProtectedDataReadyEvent, PublicDataReadyEvent } from \"../AppRouterReducer.ts\";\nimport type { FireflyRuntime } from \"../FireflyRuntime.tsx\";\nimport { ApplicationBootstrappingStartedEvent } from \"../initializeFirefly.ts\";\nimport { ProtectedDataFetchFailedEvent, ProtectedDataFetchStartedEvent } from \"../useProtectedDataQueries.ts\";\nimport { PublicDataFetchFailedEvent, PublicDataFetchStartedEvent } from \"../usePublicDataQueries.ts\";\nimport { type ActiveSpan, createOverrideFetchRequestSpanWithActiveSpanContext, registerActiveSpanStack } from \"./activeSpan.ts\";\nimport { getTracer } from \"./tracer.ts\";\nimport { endActiveSpan, startActiveChildSpan, startChildSpan, startSpan, traceError } from \"./utils.ts\";\n\n// TIPS:\n// To query those traces in Honeycomb, use the following query filter: \"root.name = squide-bootstrapping\".\n\ntype DataFetchState = \"none\" | \"fetching-data\" | \"public-data-ready\" | \"protected-data-ready\" | \"data-ready\" | \"data-fetch-failed\";\n\nexport function reduceDataFetchEvents(\n runtime: FireflyRuntime,\n onDataFetchStarted: () => void,\n onDataReady: () => void,\n onPublicDataFetchStarted: () => void,\n onPublicDataReady: () => void,\n onProtectedDataFetchStarted: () => void,\n onProtectedDataReady: () => void,\n onDataFetchFailed: (queriesErrors: Error[]) => void\n) {\n let dataFetchState: DataFetchState = \"none\";\n\n runtime.eventBus.addListener(PublicDataFetchStartedEvent, () => {\n if (dataFetchState === \"none\") {\n dataFetchState = \"fetching-data\";\n onDataFetchStarted();\n }\n\n onPublicDataFetchStarted();\n }, { once: true });\n\n runtime.eventBus.addListener(PublicDataReadyEvent, () => {\n onPublicDataReady();\n\n if (dataFetchState === \"fetching-data\") {\n dataFetchState = \"public-data-ready\";\n } else if (dataFetchState === \"protected-data-ready\") {\n dataFetchState = \"data-ready\";\n onDataReady();\n }\n }, { once: true });\n\n runtime.eventBus.addListener(ProtectedDataFetchStartedEvent, () => {\n if (dataFetchState === \"none\") {\n dataFetchState = \"fetching-data\";\n onDataFetchStarted();\n }\n\n onProtectedDataFetchStarted();\n }, { once: true });\n\n runtime.eventBus.addListener(ProtectedDataReadyEvent, () => {\n onProtectedDataReady();\n\n if (dataFetchState === \"fetching-data\") {\n dataFetchState = \"protected-data-ready\";\n } else if (dataFetchState === \"public-data-ready\") {\n dataFetchState = \"data-ready\";\n onDataReady();\n }\n }, { once: true });\n\n const handleDataFetchFailed = (payload: unknown) => {\n if (dataFetchState !== \"data-fetch-failed\") {\n dataFetchState = \"data-fetch-failed\";\n\n onDataFetchFailed(payload as Error[]);\n }\n };\n\n runtime.eventBus.addListener(PublicDataFetchFailedEvent, handleDataFetchFailed, { once: true });\n runtime.eventBus.addListener(ProtectedDataFetchFailedEvent, handleDataFetchFailed, { once: true });\n}\n\nfunction registerTrackingListeners(runtime: FireflyRuntime) {\n let bootstrappingSpan: Span;\n let localModuleRegistrationSpan: Span;\n let localModuleDeferredRegistrationSpan: Span;\n let remoteModuleRegistrationSpan: Span;\n let remoteModuleDeferredRegistrationSpan: Span;\n let dataFetchSpan: ActiveSpan;\n let deferredRegistrationsUpdateSpan: Span;\n let localModuleDeferredRegistrationsUpdateSpan: ActiveSpan;\n let remoteModuleDeferredRegistrationsUpdateSpan: ActiveSpan;\n\n runtime.eventBus.addListener(ApplicationBootstrappingStartedEvent, () => {\n bootstrappingSpan = startSpan((options, context) => getTracer().startSpan(\"squide-bootstrapping\", options, context));\n }, { once: true });\n\n runtime.eventBus.addListener(ApplicationBoostrappedEvent, () => {\n if (bootstrappingSpan) {\n bootstrappingSpan.end();\n }\n }, { once: true });\n\n runtime.eventBus.addListener(MswReadyEvent, () => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"msw-ready\");\n }\n }, { once: true });\n\n runtime.eventBus.addListener(LocalModulesRegistrationStartedEvent, (payload: unknown) => {\n const attributes = {\n \"app.squide.module_count\": (payload as LocalModulesRegistrationStartedEventPayload).moduleCount\n };\n\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"local-module-registration-started\", attributes);\n }\n\n localModuleRegistrationSpan = startChildSpan(bootstrappingSpan, (options, context) => {\n return getTracer().startSpan(\"local-module-registration\", { ...options, attributes }, context);\n });\n }, { once: true });\n\n runtime.eventBus.addListener(LocalModulesRegistrationCompletedEvent, (payload: unknown) => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"local-module-registration-completed\", {\n \"app.squide.module_count\": (payload as LocalModulesRegistrationCompletedEventPayload).moduleCount\n });\n }\n\n if (localModuleRegistrationSpan) {\n localModuleRegistrationSpan.end();\n }\n }, { once: true });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(LocalModuleRegistrationFailedEvent, (payload: unknown) => {\n const registrationError = payload as ModuleRegistrationError;\n\n if (localModuleRegistrationSpan) {\n traceError(localModuleRegistrationSpan, registrationError);\n }\n });\n\n runtime.eventBus.addListener(LocalModulesDeferredRegistrationStartedEvent, (payload: unknown) => {\n const attributes = {\n \"app.squide.registration_count\": (payload as LocalModulesDeferredRegistrationStartedEventPayload).registrationCount\n };\n\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"local-module-deferred-registration-started\", attributes);\n }\n\n localModuleDeferredRegistrationSpan = startChildSpan(bootstrappingSpan, (options, context) => {\n return getTracer().startSpan(\"local-module-deferred-registration\", { ...options, attributes }, context);\n });\n }, { once: true });\n\n runtime.eventBus.addListener(LocalModulesDeferredRegistrationCompletedEvent, (payload: unknown) => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"local-module-deferred-registration-completed\", {\n \"app.squide.registration_count\": (payload as LocalModulesDeferredRegistrationCompletedEventPayload).registrationCount\n });\n }\n\n if (localModuleDeferredRegistrationSpan) {\n localModuleDeferredRegistrationSpan.end();\n }\n }, { once: true });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(LocalModuleDeferredRegistrationFailedEvent, (payload: unknown) => {\n const registrationError = payload as ModuleRegistrationError;\n\n if (localModuleDeferredRegistrationSpan) {\n traceError(localModuleRegistrationSpan, registrationError);\n }\n });\n\n runtime.eventBus.addListener(RemoteModulesRegistrationStartedEvent, (payload: unknown) => {\n const attributes = {\n \"app.squide.remote_count\": (payload as RemoteModulesRegistrationStartedEventPayload).remoteCount\n };\n\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"remote-module-registration-started\", attributes);\n }\n\n remoteModuleRegistrationSpan = startChildSpan(bootstrappingSpan, (options, context) => {\n return getTracer().startSpan(\"remote-module-registration\", { ...options, attributes }, context);\n });\n }, { once: true });\n\n runtime.eventBus.addListener(RemoteModulesRegistrationCompletedEvent, (payload: unknown) => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"remote-module-registration-completed\", {\n \"app.squide.remote_count\": (payload as RemoteModulesRegistrationCompletedEventPayload).remoteCount\n });\n }\n\n if (remoteModuleRegistrationSpan) {\n remoteModuleRegistrationSpan.end();\n }\n }, { once: true });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(RemoteModuleRegistrationFailedEvent, (payload: unknown) => {\n const registrationError = payload as RemoteModuleRegistrationError;\n\n if (remoteModuleRegistrationSpan) {\n traceError(remoteModuleRegistrationSpan, registrationError);\n }\n });\n\n runtime.eventBus.addListener(RemoteModulesDeferredRegistrationStartedEvent, (payload: unknown) => {\n const attributes = {\n \"app.squide.registration_count\": (payload as RemoteModulesDeferredRegistrationStartedEventPayload).registrationCount\n };\n\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"remote-module-deferred-registration-started\", attributes);\n }\n\n remoteModuleDeferredRegistrationSpan = startChildSpan(bootstrappingSpan, (options, context) => {\n return getTracer().startSpan(\"remote-module-deferred-registration\", { ...options, attributes }, context);\n });\n }, { once: true });\n\n runtime.eventBus.addListener(RemoteModulesDeferredRegistrationCompletedEvent, (payload: unknown) => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"remote-module-deferred-registration-completed\", {\n \"app.squide.registration_count\": (payload as RemoteModulesDeferredRegistrationCompletedEventPayload).registrationCount\n });\n }\n\n if (remoteModuleDeferredRegistrationSpan) {\n remoteModuleDeferredRegistrationSpan.end();\n }\n }, { once: true });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(RemoteModuleDeferredRegistrationFailedEvent, (payload: unknown) => {\n const registrationError = payload as RemoteModuleRegistrationError;\n\n if (remoteModuleDeferredRegistrationSpan) {\n traceError(remoteModuleDeferredRegistrationSpan, registrationError);\n }\n });\n\n const handleFetchDataStarted = () => {\n dataFetchSpan = startActiveChildSpan(bootstrappingSpan, (options, context) => {\n const name = \"data-fetch\";\n const span = getTracer().startSpan(name, options, context);\n\n return {\n name,\n span\n };\n });\n };\n\n const handleDataReady = () => {\n if (dataFetchSpan) {\n endActiveSpan(dataFetchSpan);\n }\n };\n\n const handlePublicDataFetchStarted = () => {\n if (dataFetchSpan) {\n dataFetchSpan.instance.addEvent(\"public-data-fetch-started\");\n }\n };\n\n const handlePublicDataReady = () => {\n if (dataFetchSpan) {\n dataFetchSpan.instance.addEvent(\"public-data-ready\");\n }\n };\n\n const handleProtectedDataFetchStarted = () => {\n if (dataFetchSpan) {\n dataFetchSpan.instance.addEvent(\"protected-data-fetch-started\");\n }\n };\n\n const handleProtectedDataReady = () => {\n if (dataFetchSpan) {\n dataFetchSpan.instance.addEvent(\"protected-data-ready\");\n }\n };\n\n const handleDataFetchFailed = (queriesErrors: Error[]) => {\n if (dataFetchSpan) {\n queriesErrors.forEach(x => {\n traceError(dataFetchSpan.instance, x);\n });\n\n dataFetchSpan.instance.end();\n }\n\n if (bootstrappingSpan) {\n queriesErrors.forEach(x => {\n traceError(bootstrappingSpan, x);\n });\n\n bootstrappingSpan.end();\n }\n };\n\n reduceDataFetchEvents(\n runtime,\n handleFetchDataStarted,\n handleDataReady,\n handlePublicDataFetchStarted,\n handlePublicDataReady,\n handleProtectedDataFetchStarted,\n handleProtectedDataReady,\n handleDataFetchFailed\n );\n\n runtime.eventBus.addListener(ModulesRegisteredEvent, () => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"modules-registered\");\n }\n }, { once: true });\n\n runtime.eventBus.addListener(ModulesReadyEvent, () => {\n if (bootstrappingSpan) {\n bootstrappingSpan.addEvent(\"modules-ready\");\n }\n }, { once: true });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(DeferredRegistrationsUpdateStartedEvent, () => {\n deferredRegistrationsUpdateSpan = startSpan((options, context) => getTracer().startSpan(\"squide-deferred-registrations-update\", options, context));\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(DeferredRegistrationsUpdateCompletedEvent, () => {\n if (deferredRegistrationsUpdateSpan) {\n deferredRegistrationsUpdateSpan.end();\n }\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(LocalModulesDeferredRegistrationsUpdateStartedEvent, (payload: unknown) => {\n const attributes = {\n \"app.squide.registration_count\": (payload as LocalModulesDeferredRegistrationsUpdateStartedEventPayload).registrationCount\n };\n\n if (deferredRegistrationsUpdateSpan) {\n deferredRegistrationsUpdateSpan.addEvent(\"local-module-deferred-registrations-update-started\", attributes);\n }\n\n localModuleDeferredRegistrationsUpdateSpan = startActiveChildSpan(deferredRegistrationsUpdateSpan, (options, context) => {\n const name = \"local-module-deferred-registrations-update\";\n\n const span = getTracer().startSpan(name, {\n attributes,\n ...options\n }, context);\n\n return {\n name,\n span\n };\n });\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(LocalModulesDeferredRegistrationsUpdateCompletedEvent, (payload: unknown) => {\n if (deferredRegistrationsUpdateSpan) {\n deferredRegistrationsUpdateSpan.addEvent(\"local-module-deferred-registrations-update-completed\", {\n \"app.squide.registration_count\": (payload as LocalModulesDeferredRegistrationsUpdateCompletedEventPayload).registrationCount\n });\n }\n\n if (localModuleDeferredRegistrationsUpdateSpan) {\n endActiveSpan(localModuleDeferredRegistrationsUpdateSpan);\n }\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(LocalModuleDeferredRegistrationUpdateFailedEvent, (payload: unknown) => {\n const registrationError = payload as ModuleRegistrationError;\n\n if (localModuleDeferredRegistrationsUpdateSpan) {\n traceError(localModuleDeferredRegistrationsUpdateSpan.instance, registrationError);\n }\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(RemoteModulesDeferredRegistrationsUpdateStartedEvent, (payload: unknown) => {\n const attributes = {\n \"app.squide.registration_count\": (payload as RemoteModulesDeferredRegistrationsUpdateStartedEventPayload).registrationCount\n };\n\n if (deferredRegistrationsUpdateSpan) {\n deferredRegistrationsUpdateSpan.addEvent(\"remote-module-deferred-registrations-update-started\", attributes);\n }\n\n remoteModuleDeferredRegistrationsUpdateSpan = startActiveChildSpan(deferredRegistrationsUpdateSpan, (options, context) => {\n const name = \"remote-module-deferred-registrations-update\";\n\n const span = getTracer().startSpan(name, {\n attributes,\n ...options\n }, context);\n\n return {\n name,\n span\n };\n });\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(RemoteModulesDeferredRegistrationsUpdateCompletedEvent, (payload: unknown) => {\n if (deferredRegistrationsUpdateSpan) {\n deferredRegistrationsUpdateSpan.addEvent(\"remote-module-deferred-registrations-update-completed\", {\n \"app.squide.registration_count\": (payload as RemoteModulesDeferredRegistrationsUpdateCompletedEventPayload).registrationCount\n });\n }\n\n if (remoteModuleDeferredRegistrationsUpdateSpan) {\n endActiveSpan(remoteModuleDeferredRegistrationsUpdateSpan);\n }\n });\n\n // Can occur multiple times.\n runtime.eventBus.addListener(RemoteModuleDeferredRegistrationUpdateFailedEvent, (payload: unknown) => {\n const registrationError = payload as RemoteModuleRegistrationError;\n\n if (remoteModuleDeferredRegistrationsUpdateSpan) {\n traceError(remoteModuleDeferredRegistrationsUpdateSpan.instance, registrationError);\n }\n });\n}\n\nfunction getRegisterFetchRequestHookFunction() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return globalThis.__WLP_HONEYCOMB_REGISTER_DYNAMIC_FETCH_REQUEST_HOOK;\n}\n\nexport function registerHoneycombInstrumentation(runtime: FireflyRuntime) {\n const registerFetchRequestHookFunction = getRegisterFetchRequestHookFunction();\n\n if (registerFetchRequestHookFunction) {\n registerActiveSpanStack();\n\n const activeSpanOverrideFunction = createOverrideFetchRequestSpanWithActiveSpanContext(runtime.logger);\n\n // Dynamically registering this request hook function to nest the HTTP requests\n // of squide bootstrapping under the appropriate Honeycomb span.\n registerFetchRequestHookFunction(activeSpanOverrideFunction);\n } else {\n runtime.logger.warning(\"[squide] Cannot register Honeycomb fetch request hook because \\\"globalThis.__WLP_HONEYCOMB_REGISTER_DYNAMIC_FETCH_REQUEST_HOOK\\\" is not available. Honeycomb instrumentation is still functional but in degraded mode.\");\n }\n\n registerTrackingListeners(runtime);\n}\n"],"names":["LocalModuleDeferredRegistrationFailedEvent","LocalModuleDeferredRegistrationUpdateFailedEvent","LocalModuleRegistrationFailedEvent","LocalModulesDeferredRegistrationCompletedEvent","LocalModulesDeferredRegistrationStartedEvent","LocalModulesDeferredRegistrationsUpdateCompletedEvent","LocalModulesDeferredRegistrationsUpdateStartedEvent","LocalModulesRegistrationCompletedEvent","LocalModulesRegistrationStartedEvent","DeferredRegistrationsUpdateCompletedEvent","DeferredRegistrationsUpdateStartedEvent","RemoteModuleDeferredRegistrationFailedEvent","RemoteModuleDeferredRegistrationUpdateFailedEvent","RemoteModuleRegistrationFailedEvent","RemoteModulesDeferredRegistrationCompletedEvent","RemoteModulesDeferredRegistrationStartedEvent","RemoteModulesDeferredRegistrationsUpdateCompletedEvent","RemoteModulesDeferredRegistrationsUpdateStartedEvent","RemoteModulesRegistrationCompletedEvent","RemoteModulesRegistrationStartedEvent","ApplicationBoostrappedEvent","ModulesReadyEvent","ModulesRegisteredEvent","MswReadyEvent","ProtectedDataReadyEvent","PublicDataReadyEvent","ApplicationBootstrappingStartedEvent","ProtectedDataFetchFailedEvent","ProtectedDataFetchStartedEvent","PublicDataFetchFailedEvent","PublicDataFetchStartedEvent","createOverrideFetchRequestSpanWithActiveSpanContext","registerActiveSpanStack","getTracer","endActiveSpan","startActiveChildSpan","startChildSpan","startSpan","traceError","reduceDataFetchEvents","runtime","onDataFetchStarted","onDataReady","onPublicDataFetchStarted","onPublicDataReady","onProtectedDataFetchStarted","onProtectedDataReady","onDataFetchFailed","dataFetchState","handleDataFetchFailed","payload","registerTrackingListeners","bootstrappingSpan","localModuleRegistrationSpan","localModuleDeferredRegistrationSpan","remoteModuleRegistrationSpan","remoteModuleDeferredRegistrationSpan","dataFetchSpan","deferredRegistrationsUpdateSpan","localModuleDeferredRegistrationsUpdateSpan","remoteModuleDeferredRegistrationsUpdateSpan","options","context","attributes","registrationError","handleFetchDataStarted","name","span","handleDataReady","handlePublicDataFetchStarted","handlePublicDataReady","handleProtectedDataFetchStarted","handleProtectedDataReady","queriesErrors","x","getRegisterFetchRequestHookFunction","globalThis","registerHoneycombInstrumentation","registerFetchRequestHookFunction","activeSpanOverrideFunction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBsB;AAoBa;AAC2I;AAE/F;AAC+B;AACT;AAC2B;AACxF;AACgE;AAOjG,SAASuC,sBACZC,OAAuB,EACvBC,kBAA8B,EAC9BC,WAAuB,EACvBC,wBAAoC,EACpCC,iBAA6B,EAC7BC,2BAAuC,EACvCC,oBAAgC,EAChCC,iBAAmD;IAEnD,IAAIC,iBAAiC;IAErCR,QAAQ,QAAQ,CAAC,WAAW,CAACV,2BAA2BA,EAAE;QACtD,IAAIkB,mBAAmB,QAAQ;YAC3BA,iBAAiB;YACjBP;QACJ;QAEAE;IACJ,GAAG;QAAE,MAAM;IAAK;IAEhBH,QAAQ,QAAQ,CAAC,WAAW,CAACf,oBAAoBA,EAAE;QAC/CmB;QAEA,IAAII,mBAAmB,iBAAiB;YACpCA,iBAAiB;QACrB,OAAO,IAAIA,mBAAmB,wBAAwB;Y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C5B3B,QAAQ,QAAQ,CAAC,WAAW,CAACxB,sDAAsDA,EAAE,CAACkC;QAClF,IAAIQ,iCAAiC;YACjCA,gCAAgC,QAAQ,CAAC,yDAAyD;gBAC9F,iCAAkCR,QAA0E,iBAAiB;YACjI;QACJ;QAEA,IAAIU,6CAA6C;YAC7C1B,aAAaA,CAAC0B;QAClB;IACJ;IAEA,4BAA4B;IAC5BpB,QAAQ,QAAQ,CAAC,WAAW,CAAC5B,iDAAiDA,EAAE,CAACsC;QAC7E,MAAMc,oBAAoBd;QAE1B,IAAIU,6CAA6C;YAC7CtB,UAAUA,CAACsB,4CAA4C,QAAQ,EAAEI;QACrE;IACJ;AACJ;AAEA,SAASW;IACL,6DAA6D;IAC7D,aAAa;IACb,OAAOC,WAAW,mDAAmD;AACzE;AAEO,SAASC,iCAAiCrC,OAAuB;IACpE,MAAMsC,mCAAmCH;IAEzC,IAAIG,kCAAkC;QAClC9C,uBAAuBA;QAEvB,MAAM+C,6BAA6BhD,mDAAmDA,CAACS,QAAQ,MAAM;QAErG,+EAA+E;QAC/E,gEAAgE;QAChEsC,iCAAiCC;IACrC,OAAO;QACHvC,QAAQ,MAAM,CAAC,OAAO,CAAC;IAC3B;IAEAW,0BAA0BX;AAC9B"}
|
package/dist/honeycomb/tracer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { trace } from "@opentelemetry/api";
|
|
2
2
|
|
|
3
3
|
;// CONCATENATED MODULE: external "@opentelemetry/api"
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__opentelemetry_api_87359e78__ from "@opent
|
|
|
6
6
|
|
|
7
7
|
function getTracer() {
|
|
8
8
|
// The tracer name is used as the "library.name" attribute.
|
|
9
|
-
return
|
|
9
|
+
return trace.getTracer("@squide/honeycomb");
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export { getTracer };
|