@pie-players/pie-players-shared 0.2.0
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/dist/config/profile.d.ts +15 -0
- package/dist/config/profile.d.ts.map +1 -0
- package/dist/config/profile.js +27 -0
- package/dist/config/profile.js.map +1 -0
- package/dist/i18n/index.d.ts +13 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +12 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/loader.d.ts +36 -0
- package/dist/i18n/loader.d.ts.map +1 -0
- package/dist/i18n/loader.js +133 -0
- package/dist/i18n/loader.js.map +1 -0
- package/dist/i18n/scripts/check-coverage.d.ts +16 -0
- package/dist/i18n/scripts/check-coverage.d.ts.map +1 -0
- package/dist/i18n/scripts/check-coverage.js +262 -0
- package/dist/i18n/scripts/check-coverage.js.map +1 -0
- package/dist/i18n/scripts/scan-hardcoded.d.ts +16 -0
- package/dist/i18n/scripts/scan-hardcoded.d.ts.map +1 -0
- package/dist/i18n/scripts/scan-hardcoded.js +266 -0
- package/dist/i18n/scripts/scan-hardcoded.js.map +1 -0
- package/dist/i18n/simple-i18n.d.ts +69 -0
- package/dist/i18n/simple-i18n.d.ts.map +1 -0
- package/dist/i18n/simple-i18n.js +199 -0
- package/dist/i18n/simple-i18n.js.map +1 -0
- package/dist/i18n/translations/ar/common.json +36 -0
- package/dist/i18n/translations/ar/toolkit.json +48 -0
- package/dist/i18n/translations/ar/tools.json +109 -0
- package/dist/i18n/translations/en/common.json +36 -0
- package/dist/i18n/translations/en/toolkit.json +48 -0
- package/dist/i18n/translations/en/tools.json +109 -0
- package/dist/i18n/translations/es/common.json +36 -0
- package/dist/i18n/translations/es/toolkit.json +48 -0
- package/dist/i18n/translations/es/tools.json +109 -0
- package/dist/i18n/translations/zh/common.json +36 -0
- package/dist/i18n/translations/zh/toolkit.json +48 -0
- package/dist/i18n/translations/zh/tools.json +109 -0
- package/dist/i18n/types.d.ts +58 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +8 -0
- package/dist/i18n/types.js.map +1 -0
- package/dist/i18n/use-i18n-standalone.svelte.d.ts +87 -0
- package/dist/i18n/use-i18n-standalone.svelte.d.ts.map +1 -0
- package/dist/i18n/use-i18n-standalone.svelte.js +151 -0
- package/dist/i18n/use-i18n-standalone.svelte.js.map +1 -0
- package/dist/i18n/use-i18n.svelte.d.ts +67 -0
- package/dist/i18n/use-i18n.svelte.d.ts.map +1 -0
- package/dist/i18n/use-i18n.svelte.js +144 -0
- package/dist/i18n/use-i18n.svelte.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/instrumentation/index.d.ts +53 -0
- package/dist/instrumentation/index.d.ts.map +1 -0
- package/dist/instrumentation/index.js +53 -0
- package/dist/instrumentation/index.js.map +1 -0
- package/dist/instrumentation/providers/BaseInstrumentationProvider.d.ts +197 -0
- package/dist/instrumentation/providers/BaseInstrumentationProvider.d.ts.map +1 -0
- package/dist/instrumentation/providers/BaseInstrumentationProvider.js +267 -0
- package/dist/instrumentation/providers/BaseInstrumentationProvider.js.map +1 -0
- package/dist/instrumentation/providers/ConsoleInstrumentationProvider.d.ts +106 -0
- package/dist/instrumentation/providers/ConsoleInstrumentationProvider.d.ts.map +1 -0
- package/dist/instrumentation/providers/ConsoleInstrumentationProvider.js +182 -0
- package/dist/instrumentation/providers/ConsoleInstrumentationProvider.js.map +1 -0
- package/dist/instrumentation/providers/DataDogInstrumentationProvider.d.ts +170 -0
- package/dist/instrumentation/providers/DataDogInstrumentationProvider.d.ts.map +1 -0
- package/dist/instrumentation/providers/DataDogInstrumentationProvider.js +183 -0
- package/dist/instrumentation/providers/DataDogInstrumentationProvider.js.map +1 -0
- package/dist/instrumentation/providers/NewRelicInstrumentationProvider.d.ts +86 -0
- package/dist/instrumentation/providers/NewRelicInstrumentationProvider.d.ts.map +1 -0
- package/dist/instrumentation/providers/NewRelicInstrumentationProvider.js +135 -0
- package/dist/instrumentation/providers/NewRelicInstrumentationProvider.js.map +1 -0
- package/dist/instrumentation/providers/index.d.ts +12 -0
- package/dist/instrumentation/providers/index.d.ts.map +1 -0
- package/dist/instrumentation/providers/index.js +12 -0
- package/dist/instrumentation/providers/index.js.map +1 -0
- package/dist/instrumentation/types.d.ts +348 -0
- package/dist/instrumentation/types.d.ts.map +1 -0
- package/dist/instrumentation/types.js +9 -0
- package/dist/instrumentation/types.js.map +1 -0
- package/dist/loader-config.d.ts +76 -0
- package/dist/loader-config.d.ts.map +1 -0
- package/dist/loader-config.js +12 -0
- package/dist/loader-config.js.map +1 -0
- package/dist/loaders/ElementLoader.d.ts +72 -0
- package/dist/loaders/ElementLoader.d.ts.map +1 -0
- package/dist/loaders/ElementLoader.js +52 -0
- package/dist/loaders/ElementLoader.js.map +1 -0
- package/dist/loaders/EsmElementLoader.d.ts +67 -0
- package/dist/loaders/EsmElementLoader.d.ts.map +1 -0
- package/dist/loaders/EsmElementLoader.js +71 -0
- package/dist/loaders/EsmElementLoader.js.map +1 -0
- package/dist/loaders/IifeElementLoader.d.ts +61 -0
- package/dist/loaders/IifeElementLoader.d.ts.map +1 -0
- package/dist/loaders/IifeElementLoader.js +63 -0
- package/dist/loaders/IifeElementLoader.js.map +1 -0
- package/dist/loaders/index.d.ts +28 -0
- package/dist/loaders/index.d.ts.map +1 -0
- package/dist/loaders/index.js +25 -0
- package/dist/loaders/index.js.map +1 -0
- package/dist/object/index.d.ts +12 -0
- package/dist/object/index.d.ts.map +1 -0
- package/dist/object/index.js +40 -0
- package/dist/object/index.js.map +1 -0
- package/dist/pie/asset-handler.d.ts +64 -0
- package/dist/pie/asset-handler.d.ts.map +1 -0
- package/dist/pie/asset-handler.js +238 -0
- package/dist/pie/asset-handler.js.map +1 -0
- package/dist/pie/component-context.d.ts +22 -0
- package/dist/pie/component-context.d.ts.map +1 -0
- package/dist/pie/component-context.js +30 -0
- package/dist/pie/component-context.js.map +1 -0
- package/dist/pie/config.d.ts +39 -0
- package/dist/pie/config.d.ts.map +1 -0
- package/dist/pie/config.js +174 -0
- package/dist/pie/config.js.map +1 -0
- package/dist/pie/configure-initialization.d.ts +35 -0
- package/dist/pie/configure-initialization.d.ts.map +1 -0
- package/dist/pie/configure-initialization.js +141 -0
- package/dist/pie/configure-initialization.js.map +1 -0
- package/dist/pie/esm-loader.d.ts +93 -0
- package/dist/pie/esm-loader.d.ts.map +1 -0
- package/dist/pie/esm-loader.js +308 -0
- package/dist/pie/esm-loader.js.map +1 -0
- package/dist/pie/iife-loader.d.ts +76 -0
- package/dist/pie/iife-loader.d.ts.map +1 -0
- package/dist/pie/iife-loader.js +303 -0
- package/dist/pie/iife-loader.js.map +1 -0
- package/dist/pie/index.d.ts +31 -0
- package/dist/pie/index.d.ts.map +1 -0
- package/dist/pie/index.js +34 -0
- package/dist/pie/index.js.map +1 -0
- package/dist/pie/initialization.d.ts +40 -0
- package/dist/pie/initialization.d.ts.map +1 -0
- package/dist/pie/initialization.js +349 -0
- package/dist/pie/initialization.js.map +1 -0
- package/dist/pie/logger.d.ts +64 -0
- package/dist/pie/logger.d.ts.map +1 -0
- package/dist/pie/logger.js +45 -0
- package/dist/pie/logger.js.map +1 -0
- package/dist/pie/math-rendering.d.ts +69 -0
- package/dist/pie/math-rendering.d.ts.map +1 -0
- package/dist/pie/math-rendering.js +98 -0
- package/dist/pie/math-rendering.js.map +1 -0
- package/dist/pie/overrides.d.ts +43 -0
- package/dist/pie/overrides.d.ts.map +1 -0
- package/dist/pie/overrides.js +146 -0
- package/dist/pie/overrides.js.map +1 -0
- package/dist/pie/player-initializer.d.ts +55 -0
- package/dist/pie/player-initializer.d.ts.map +1 -0
- package/dist/pie/player-initializer.js +123 -0
- package/dist/pie/player-initializer.js.map +1 -0
- package/dist/pie/registry.d.ts +11 -0
- package/dist/pie/registry.d.ts.map +1 -0
- package/dist/pie/registry.js +21 -0
- package/dist/pie/registry.js.map +1 -0
- package/dist/pie/resource-monitor.d.ts +208 -0
- package/dist/pie/resource-monitor.d.ts.map +1 -0
- package/dist/pie/resource-monitor.js +969 -0
- package/dist/pie/resource-monitor.js.map +1 -0
- package/dist/pie/scoring.d.ts +17 -0
- package/dist/pie/scoring.d.ts.map +1 -0
- package/dist/pie/scoring.js +84 -0
- package/dist/pie/scoring.js.map +1 -0
- package/dist/pie/types.d.ts +136 -0
- package/dist/pie/types.d.ts.map +1 -0
- package/dist/pie/types.js +52 -0
- package/dist/pie/types.js.map +1 -0
- package/dist/pie/updates.d.ts +20 -0
- package/dist/pie/updates.d.ts.map +1 -0
- package/dist/pie/updates.js +175 -0
- package/dist/pie/updates.js.map +1 -0
- package/dist/pie/use-resource-monitor.svelte.d.ts +56 -0
- package/dist/pie/use-resource-monitor.svelte.d.ts.map +1 -0
- package/dist/pie/use-resource-monitor.svelte.js +117 -0
- package/dist/pie/use-resource-monitor.svelte.js.map +1 -0
- package/dist/pie/utils.d.ts +44 -0
- package/dist/pie/utils.d.ts.map +1 -0
- package/dist/pie/utils.js +74 -0
- package/dist/pie/utils.js.map +1 -0
- package/dist/types/custom-elements.d.ts +183 -0
- package/dist/types/custom-elements.d.ts.map +1 -0
- package/dist/types/custom-elements.js +8 -0
- package/dist/types/custom-elements.js.map +1 -0
- package/dist/types/index.d.ts +761 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +120 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/search.d.ts +105 -0
- package/dist/types/search.d.ts.map +1 -0
- package/dist/types/search.js +12 -0
- package/dist/types/search.js.map +1 -0
- package/dist/types/transform.d.ts +48 -0
- package/dist/types/transform.d.ts.map +1 -0
- package/dist/types/transform.js +21 -0
- package/dist/types/transform.js.map +1 -0
- package/dist/ui/focus-trap.d.ts +10 -0
- package/dist/ui/focus-trap.d.ts.map +1 -0
- package/dist/ui/focus-trap.js +30 -0
- package/dist/ui/focus-trap.js.map +1 -0
- package/dist/ui/safe-storage.d.ts +3 -0
- package/dist/ui/safe-storage.d.ts.map +1 -0
- package/dist/ui/safe-storage.js +21 -0
- package/dist/ui/safe-storage.js.map +1 -0
- package/package.json +118 -0
- package/src/components/PieItemPlayer.svelte +604 -0
- package/src/components/PiePreviewLayout.svelte +144 -0
- package/src/components/PiePreviewToggle.svelte +110 -0
- package/src/components/PieSpinner.svelte +85 -0
- package/src/components/ToolSettingsButton.svelte +31 -0
- package/src/components/ToolSettingsPanel.svelte +90 -0
- package/src/components/index.ts +6 -0
- package/src/i18n/README.md +223 -0
- package/src/i18n/index.ts +26 -0
- package/src/i18n/loader.ts +156 -0
- package/src/i18n/scripts/check-coverage.ts +345 -0
- package/src/i18n/scripts/scan-hardcoded.ts +342 -0
- package/src/i18n/simple-i18n.ts +236 -0
- package/src/i18n/translations/ar/common.json +36 -0
- package/src/i18n/translations/ar/toolkit.json +48 -0
- package/src/i18n/translations/ar/tools.json +109 -0
- package/src/i18n/translations/en/common.json +36 -0
- package/src/i18n/translations/en/toolkit.json +48 -0
- package/src/i18n/translations/en/tools.json +109 -0
- package/src/i18n/translations/es/common.json +36 -0
- package/src/i18n/translations/es/toolkit.json +48 -0
- package/src/i18n/translations/es/tools.json +109 -0
- package/src/i18n/translations/zh/common.json +36 -0
- package/src/i18n/translations/zh/toolkit.json +48 -0
- package/src/i18n/translations/zh/tools.json +109 -0
- package/src/i18n/types.ts +66 -0
- package/src/i18n/use-i18n-standalone.svelte.ts +184 -0
- package/src/i18n/use-i18n.svelte.ts +163 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* New Relic Instrumentation Provider
|
|
3
|
+
*
|
|
4
|
+
* Default provider that maintains backwards compatibility with existing
|
|
5
|
+
* New Relic instrumentation.
|
|
6
|
+
*
|
|
7
|
+
* This provider wraps the global `window.newrelic` object provided by
|
|
8
|
+
* the New Relic Browser Agent.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const provider = new NewRelicInstrumentationProvider();
|
|
13
|
+
* await provider.initialize();
|
|
14
|
+
*
|
|
15
|
+
* if (provider.isReady()) {
|
|
16
|
+
* provider.trackError(new Error('Something went wrong'), {
|
|
17
|
+
* component: 'my-component',
|
|
18
|
+
* errorType: 'ValidationError'
|
|
19
|
+
* });
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import type { InstrumentationConfig } from "../types";
|
|
24
|
+
import { BaseInstrumentationProvider } from "./BaseInstrumentationProvider";
|
|
25
|
+
export declare class NewRelicInstrumentationProvider extends BaseInstrumentationProvider {
|
|
26
|
+
readonly providerId = "newrelic";
|
|
27
|
+
readonly providerName = "New Relic";
|
|
28
|
+
/**
|
|
29
|
+
* Initialize the New Relic provider
|
|
30
|
+
*
|
|
31
|
+
* Checks if the New Relic Browser Agent is available via `window.newrelic`.
|
|
32
|
+
* If not available, initialization succeeds but `isReady()` will return false.
|
|
33
|
+
*
|
|
34
|
+
* @param config Optional configuration
|
|
35
|
+
*/
|
|
36
|
+
initialize(config?: InstrumentationConfig): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Check if provider is ready
|
|
39
|
+
*
|
|
40
|
+
* @returns true if New Relic is available and initialized
|
|
41
|
+
*/
|
|
42
|
+
isReady(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Cleanup provider resources
|
|
45
|
+
*
|
|
46
|
+
* Marks provider as uninitialized. The global `window.newrelic` object
|
|
47
|
+
* is not modified.
|
|
48
|
+
*/
|
|
49
|
+
destroy(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Track an error with New Relic
|
|
52
|
+
*
|
|
53
|
+
* Calls `newrelic.noticeError(error, attributes)`
|
|
54
|
+
*
|
|
55
|
+
* @param error The error to track
|
|
56
|
+
* @param attributes Transformed attributes (already filtered and transformed by base class)
|
|
57
|
+
*/
|
|
58
|
+
protected doTrackError(error: Error, attributes: Record<string, any>): void;
|
|
59
|
+
/**
|
|
60
|
+
* Track a custom event/page action with New Relic
|
|
61
|
+
*
|
|
62
|
+
* Calls `newrelic.addPageAction(eventName, attributes)`
|
|
63
|
+
*
|
|
64
|
+
* @param eventName Name of the event
|
|
65
|
+
* @param attributes Transformed attributes (already filtered and transformed by base class)
|
|
66
|
+
*/
|
|
67
|
+
protected doTrackEvent(eventName: string, attributes: Record<string, any>): void;
|
|
68
|
+
/**
|
|
69
|
+
* Set user context for session tracking
|
|
70
|
+
*
|
|
71
|
+
* Calls `newrelic.setUserId()` and `newrelic.setCustomAttribute()` for user attributes.
|
|
72
|
+
*
|
|
73
|
+
* @param userId User identifier
|
|
74
|
+
* @param attributes Optional user attributes
|
|
75
|
+
*/
|
|
76
|
+
protected doSetUserContext(userId: string, attributes?: Record<string, any>): void;
|
|
77
|
+
/**
|
|
78
|
+
* Set global custom attributes
|
|
79
|
+
*
|
|
80
|
+
* Calls `newrelic.setCustomAttribute()` for each attribute.
|
|
81
|
+
*
|
|
82
|
+
* @param attributes Attributes to set globally
|
|
83
|
+
*/
|
|
84
|
+
protected doSetGlobalAttributes(attributes: Record<string, any>): void;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=NewRelicInstrumentationProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewRelicInstrumentationProvider.d.ts","sourceRoot":"","sources":["../../../src/instrumentation/providers/NewRelicInstrumentationProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,qBAAa,+BAAgC,SAAQ,2BAA2B;IAC/E,QAAQ,CAAC,UAAU,cAAc;IACjC,QAAQ,CAAC,YAAY,eAAe;IAEpC;;;;;;;OAOG;IACG,UAAU,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB/D;;;;OAIG;IACH,OAAO,IAAI,OAAO;IAQlB;;;;;OAKG;IACH,OAAO,IAAI,IAAI;IAOf;;;;;;;OAOG;IACH,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAK3E;;;;;;;OAOG;IACH,SAAS,CAAC,YAAY,CACrB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC7B,IAAI;IAKP;;;;;;;OAOG;IACH,SAAS,CAAC,gBAAgB,CACzB,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC9B,IAAI;IAgBP;;;;;;OAMG;IACH,SAAS,CAAC,qBAAqB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;CAStE"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* New Relic Instrumentation Provider
|
|
3
|
+
*
|
|
4
|
+
* Default provider that maintains backwards compatibility with existing
|
|
5
|
+
* New Relic instrumentation.
|
|
6
|
+
*
|
|
7
|
+
* This provider wraps the global `window.newrelic` object provided by
|
|
8
|
+
* the New Relic Browser Agent.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const provider = new NewRelicInstrumentationProvider();
|
|
13
|
+
* await provider.initialize();
|
|
14
|
+
*
|
|
15
|
+
* if (provider.isReady()) {
|
|
16
|
+
* provider.trackError(new Error('Something went wrong'), {
|
|
17
|
+
* component: 'my-component',
|
|
18
|
+
* errorType: 'ValidationError'
|
|
19
|
+
* });
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import { BaseInstrumentationProvider } from "./BaseInstrumentationProvider";
|
|
24
|
+
export class NewRelicInstrumentationProvider extends BaseInstrumentationProvider {
|
|
25
|
+
providerId = "newrelic";
|
|
26
|
+
providerName = "New Relic";
|
|
27
|
+
/**
|
|
28
|
+
* Initialize the New Relic provider
|
|
29
|
+
*
|
|
30
|
+
* Checks if the New Relic Browser Agent is available via `window.newrelic`.
|
|
31
|
+
* If not available, initialization succeeds but `isReady()` will return false.
|
|
32
|
+
*
|
|
33
|
+
* @param config Optional configuration
|
|
34
|
+
*/
|
|
35
|
+
async initialize(config) {
|
|
36
|
+
this.config = config;
|
|
37
|
+
// Check if New Relic is available
|
|
38
|
+
if (typeof window !== "undefined" && window.newrelic) {
|
|
39
|
+
this.initialized = true;
|
|
40
|
+
if (this.config?.debug) {
|
|
41
|
+
console.log("[NewRelicProvider] Initialized successfully");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
if (this.config?.debug) {
|
|
46
|
+
console.warn("[NewRelicProvider] New Relic not available (window.newrelic not found)");
|
|
47
|
+
}
|
|
48
|
+
// Don't throw - allow graceful degradation
|
|
49
|
+
this.initialized = false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Check if provider is ready
|
|
54
|
+
*
|
|
55
|
+
* @returns true if New Relic is available and initialized
|
|
56
|
+
*/
|
|
57
|
+
isReady() {
|
|
58
|
+
return (this.initialized &&
|
|
59
|
+
typeof window !== "undefined" &&
|
|
60
|
+
!!window.newrelic);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Cleanup provider resources
|
|
64
|
+
*
|
|
65
|
+
* Marks provider as uninitialized. The global `window.newrelic` object
|
|
66
|
+
* is not modified.
|
|
67
|
+
*/
|
|
68
|
+
destroy() {
|
|
69
|
+
this.initialized = false;
|
|
70
|
+
if (this.config?.debug) {
|
|
71
|
+
console.log("[NewRelicProvider] Destroyed");
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Track an error with New Relic
|
|
76
|
+
*
|
|
77
|
+
* Calls `newrelic.noticeError(error, attributes)`
|
|
78
|
+
*
|
|
79
|
+
* @param error The error to track
|
|
80
|
+
* @param attributes Transformed attributes (already filtered and transformed by base class)
|
|
81
|
+
*/
|
|
82
|
+
doTrackError(error, attributes) {
|
|
83
|
+
const newrelic = window.newrelic;
|
|
84
|
+
newrelic.noticeError(error, attributes);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Track a custom event/page action with New Relic
|
|
88
|
+
*
|
|
89
|
+
* Calls `newrelic.addPageAction(eventName, attributes)`
|
|
90
|
+
*
|
|
91
|
+
* @param eventName Name of the event
|
|
92
|
+
* @param attributes Transformed attributes (already filtered and transformed by base class)
|
|
93
|
+
*/
|
|
94
|
+
doTrackEvent(eventName, attributes) {
|
|
95
|
+
const newrelic = window.newrelic;
|
|
96
|
+
newrelic.addPageAction(eventName, attributes);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Set user context for session tracking
|
|
100
|
+
*
|
|
101
|
+
* Calls `newrelic.setUserId()` and `newrelic.setCustomAttribute()` for user attributes.
|
|
102
|
+
*
|
|
103
|
+
* @param userId User identifier
|
|
104
|
+
* @param attributes Optional user attributes
|
|
105
|
+
*/
|
|
106
|
+
doSetUserContext(userId, attributes) {
|
|
107
|
+
const newrelic = window.newrelic;
|
|
108
|
+
// Set user ID if method exists
|
|
109
|
+
if (newrelic.setUserId) {
|
|
110
|
+
newrelic.setUserId(userId);
|
|
111
|
+
}
|
|
112
|
+
// Set custom attributes for user
|
|
113
|
+
if (attributes && newrelic.setCustomAttribute) {
|
|
114
|
+
for (const [key, value] of Object.entries(attributes)) {
|
|
115
|
+
newrelic.setCustomAttribute(key, value);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Set global custom attributes
|
|
121
|
+
*
|
|
122
|
+
* Calls `newrelic.setCustomAttribute()` for each attribute.
|
|
123
|
+
*
|
|
124
|
+
* @param attributes Attributes to set globally
|
|
125
|
+
*/
|
|
126
|
+
doSetGlobalAttributes(attributes) {
|
|
127
|
+
const newrelic = window.newrelic;
|
|
128
|
+
if (newrelic.setCustomAttribute) {
|
|
129
|
+
for (const [key, value] of Object.entries(attributes)) {
|
|
130
|
+
newrelic.setCustomAttribute(key, value);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=NewRelicInstrumentationProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewRelicInstrumentationProvider.js","sourceRoot":"","sources":["../../../src/instrumentation/providers/NewRelicInstrumentationProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,MAAM,OAAO,+BAAgC,SAAQ,2BAA2B;IACtE,UAAU,GAAG,UAAU,CAAC;IACxB,YAAY,GAAG,WAAW,CAAC;IAEpC;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CAAC,MAA8B;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,kCAAkC;QAClC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAK,MAAc,CAAC,QAAQ,EAAE,CAAC;YAC/D,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;gBACxB,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;YAC5D,CAAC;QACF,CAAC;aAAM,CAAC;YACP,IAAI,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;gBACxB,OAAO,CAAC,IAAI,CACX,wEAAwE,CACxE,CAAC;YACH,CAAC;YACD,2CAA2C;YAC3C,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAC1B,CAAC;IACF,CAAC;IAED;;;;OAIG;IACH,OAAO;QACN,OAAO,CACN,IAAI,CAAC,WAAW;YAChB,OAAO,MAAM,KAAK,WAAW;YAC7B,CAAC,CAAE,MAAc,CAAC,QAAQ,CAC1B,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,OAAO;QACN,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC7C,CAAC;IACF,CAAC;IAED;;;;;;;OAOG;IACO,YAAY,CAAC,KAAY,EAAE,UAA+B;QACnE,MAAM,QAAQ,GAAI,MAAc,CAAC,QAAQ,CAAC;QAC1C,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;;OAOG;IACO,YAAY,CACrB,SAAiB,EACjB,UAA+B;QAE/B,MAAM,QAAQ,GAAI,MAAc,CAAC,QAAQ,CAAC;QAC1C,QAAQ,CAAC,aAAa,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;;OAOG;IACO,gBAAgB,CACzB,MAAc,EACd,UAAgC;QAEhC,MAAM,QAAQ,GAAI,MAAc,CAAC,QAAQ,CAAC;QAE1C,+BAA+B;QAC/B,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC;YACxB,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;QAED,iCAAiC;QACjC,IAAI,UAAU,IAAI,QAAQ,CAAC,kBAAkB,EAAE,CAAC;YAC/C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;gBACvD,QAAQ,CAAC,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACzC,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;;OAMG;IACO,qBAAqB,CAAC,UAA+B;QAC9D,MAAM,QAAQ,GAAI,MAAc,CAAC,QAAQ,CAAC;QAE1C,IAAI,QAAQ,CAAC,kBAAkB,EAAE,CAAC;YACjC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;gBACvD,QAAQ,CAAC,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACzC,CAAC;QACF,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instrumentation Providers
|
|
3
|
+
*
|
|
4
|
+
* This module exports all available instrumentation providers.
|
|
5
|
+
*/
|
|
6
|
+
export { BaseInstrumentationProvider } from "./BaseInstrumentationProvider";
|
|
7
|
+
export type { ConsoleProviderConfig } from "./ConsoleInstrumentationProvider";
|
|
8
|
+
export { ConsoleInstrumentationProvider } from "./ConsoleInstrumentationProvider";
|
|
9
|
+
export type { DataDogConfig } from "./DataDogInstrumentationProvider";
|
|
10
|
+
export { DataDogInstrumentationProvider } from "./DataDogInstrumentationProvider";
|
|
11
|
+
export { NewRelicInstrumentationProvider } from "./NewRelicInstrumentationProvider";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/instrumentation/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,YAAY,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAE9E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instrumentation Providers
|
|
3
|
+
*
|
|
4
|
+
* This module exports all available instrumentation providers.
|
|
5
|
+
*/
|
|
6
|
+
// Base class for creating custom providers
|
|
7
|
+
export { BaseInstrumentationProvider } from "./BaseInstrumentationProvider";
|
|
8
|
+
// Built-in providers
|
|
9
|
+
export { ConsoleInstrumentationProvider } from "./ConsoleInstrumentationProvider";
|
|
10
|
+
export { DataDogInstrumentationProvider } from "./DataDogInstrumentationProvider";
|
|
11
|
+
export { NewRelicInstrumentationProvider } from "./NewRelicInstrumentationProvider";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/instrumentation/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,2CAA2C;AAC3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,qBAAqB;AACrB,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instrumentation Types
|
|
3
|
+
*
|
|
4
|
+
* Core interfaces and types for pluggable instrumentation system.
|
|
5
|
+
* Abstracts vendor-specific APIs (New Relic, DataDog, Dynatrace, etc.)
|
|
6
|
+
* to enable clients to use any instrumentation provider.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Pluggable instrumentation provider interface
|
|
10
|
+
*
|
|
11
|
+
* All instrumentation providers must implement this interface.
|
|
12
|
+
* Provides methods for tracking errors, events, and metrics.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* class CustomProvider implements InstrumentationProvider {
|
|
17
|
+
* readonly providerId = 'custom';
|
|
18
|
+
* readonly providerName = 'Custom Analytics';
|
|
19
|
+
*
|
|
20
|
+
* async initialize(config?: InstrumentationConfig): Promise<void> {
|
|
21
|
+
* // Initialize your analytics SDK
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* trackError(error: Error, attributes: ErrorAttributes): void {
|
|
25
|
+
* // Send error to your analytics backend
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* trackEvent(eventName: string, attributes: EventAttributes): void {
|
|
29
|
+
* // Send event to your analytics backend
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* isReady(): boolean {
|
|
33
|
+
* return true;
|
|
34
|
+
* }
|
|
35
|
+
*
|
|
36
|
+
* destroy(): void {
|
|
37
|
+
* // Cleanup
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export interface InstrumentationProvider {
|
|
43
|
+
/**
|
|
44
|
+
* Unique identifier for the provider (e.g., 'newrelic', 'datadog', 'console')
|
|
45
|
+
*/
|
|
46
|
+
readonly providerId: string;
|
|
47
|
+
/**
|
|
48
|
+
* Human-readable provider name (e.g., 'New Relic', 'DataDog RUM')
|
|
49
|
+
*/
|
|
50
|
+
readonly providerName: string;
|
|
51
|
+
/**
|
|
52
|
+
* Initialize the provider (load SDKs, configure clients, etc.)
|
|
53
|
+
*
|
|
54
|
+
* @param config Optional configuration for the provider
|
|
55
|
+
*/
|
|
56
|
+
initialize(config?: InstrumentationConfig): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Track an error with contextual attributes
|
|
59
|
+
*
|
|
60
|
+
* @param error The error to track
|
|
61
|
+
* @param attributes Contextual attributes about the error
|
|
62
|
+
*/
|
|
63
|
+
trackError(error: Error, attributes: ErrorAttributes): void;
|
|
64
|
+
/**
|
|
65
|
+
* Track a custom event/page action
|
|
66
|
+
*
|
|
67
|
+
* @param eventName Name of the event (e.g., 'pie-resource-load', 'pie-resource-retry')
|
|
68
|
+
* @param attributes Contextual attributes about the event
|
|
69
|
+
*/
|
|
70
|
+
trackEvent(eventName: string, attributes: EventAttributes): void;
|
|
71
|
+
/**
|
|
72
|
+
* Track a performance metric
|
|
73
|
+
*
|
|
74
|
+
* Optional - not all providers support direct metrics.
|
|
75
|
+
* For providers without metric support, consider tracking as custom events instead.
|
|
76
|
+
*
|
|
77
|
+
* @param metricName Name of the metric
|
|
78
|
+
* @param value Numeric value of the metric
|
|
79
|
+
* @param attributes Optional attributes about the metric
|
|
80
|
+
*/
|
|
81
|
+
trackMetric?(metricName: string, value: number, attributes?: MetricAttributes): void;
|
|
82
|
+
/**
|
|
83
|
+
* Set user context for session tracking
|
|
84
|
+
*
|
|
85
|
+
* Optional - associates user information with subsequent events/errors.
|
|
86
|
+
*
|
|
87
|
+
* @param userId User identifier
|
|
88
|
+
* @param attributes Optional user attributes
|
|
89
|
+
*/
|
|
90
|
+
setUserContext?(userId: string, attributes?: Record<string, any>): void;
|
|
91
|
+
/**
|
|
92
|
+
* Set custom attributes that apply to all subsequent events
|
|
93
|
+
*
|
|
94
|
+
* Optional - useful for setting context like environment, version, etc.
|
|
95
|
+
*
|
|
96
|
+
* @param attributes Attributes to set globally
|
|
97
|
+
*/
|
|
98
|
+
setGlobalAttributes?(attributes: Record<string, any>): void;
|
|
99
|
+
/**
|
|
100
|
+
* Cleanup provider resources
|
|
101
|
+
*
|
|
102
|
+
* Called when the provider is being destroyed or replaced.
|
|
103
|
+
*/
|
|
104
|
+
destroy(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Check if provider is ready to track events
|
|
107
|
+
*
|
|
108
|
+
* @returns true if provider is initialized and ready, false otherwise
|
|
109
|
+
*/
|
|
110
|
+
isReady(): boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Configuration for instrumentation providers
|
|
114
|
+
*/
|
|
115
|
+
export interface InstrumentationConfig {
|
|
116
|
+
/**
|
|
117
|
+
* Enable/disable instrumentation
|
|
118
|
+
*
|
|
119
|
+
* @default true
|
|
120
|
+
*/
|
|
121
|
+
enabled?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Enable debug logging
|
|
124
|
+
*
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
debug?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Sample rate for events (0.0 to 1.0)
|
|
130
|
+
*
|
|
131
|
+
* 1.0 = 100% of events tracked
|
|
132
|
+
* 0.5 = 50% of events tracked
|
|
133
|
+
* 0.1 = 10% of events tracked
|
|
134
|
+
*
|
|
135
|
+
* @default 1.0
|
|
136
|
+
*/
|
|
137
|
+
sampleRate?: number;
|
|
138
|
+
/**
|
|
139
|
+
* Provider-specific settings
|
|
140
|
+
*
|
|
141
|
+
* Each provider can define its own configuration structure.
|
|
142
|
+
*
|
|
143
|
+
* @example New Relic
|
|
144
|
+
* ```typescript
|
|
145
|
+
* providerSettings: {
|
|
146
|
+
* // New Relic doesn't need additional config (uses global newrelic object)
|
|
147
|
+
* }
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* @example DataDog
|
|
151
|
+
* ```typescript
|
|
152
|
+
* providerSettings: {
|
|
153
|
+
* applicationId: 'abc123',
|
|
154
|
+
* clientToken: 'pub_xyz',
|
|
155
|
+
* site: 'datadoghq.com',
|
|
156
|
+
* service: 'pie-players'
|
|
157
|
+
* }
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
providerSettings?: Record<string, any>;
|
|
161
|
+
/**
|
|
162
|
+
* Filter function for errors
|
|
163
|
+
*
|
|
164
|
+
* Return false to skip tracking the error.
|
|
165
|
+
*
|
|
166
|
+
* @param error The error being tracked
|
|
167
|
+
* @param attributes The error attributes
|
|
168
|
+
* @returns true to track, false to skip
|
|
169
|
+
*/
|
|
170
|
+
errorFilter?: (error: Error, attributes: ErrorAttributes) => boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Filter function for events
|
|
173
|
+
*
|
|
174
|
+
* Return false to skip tracking the event.
|
|
175
|
+
*
|
|
176
|
+
* @param eventName The event name
|
|
177
|
+
* @param attributes The event attributes
|
|
178
|
+
* @returns true to track, false to skip
|
|
179
|
+
*/
|
|
180
|
+
eventFilter?: (eventName: string, attributes: EventAttributes) => boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Transform function for attributes
|
|
183
|
+
*
|
|
184
|
+
* Allows modifying or enriching attributes before they're sent to the provider.
|
|
185
|
+
*
|
|
186
|
+
* @param attributes The original attributes
|
|
187
|
+
* @returns The transformed attributes
|
|
188
|
+
*/
|
|
189
|
+
attributeTransformer?: (attributes: Record<string, any>) => Record<string, any>;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Common error attributes
|
|
193
|
+
*
|
|
194
|
+
* These attributes are sent with error tracking calls.
|
|
195
|
+
* All providers should support these base attributes.
|
|
196
|
+
*/
|
|
197
|
+
export interface ErrorAttributes {
|
|
198
|
+
/**
|
|
199
|
+
* Component that generated the error
|
|
200
|
+
*
|
|
201
|
+
* Examples: 'pie-fixed-player', 'pie-resource-monitor', 'pie-esm-player'
|
|
202
|
+
*/
|
|
203
|
+
component: string;
|
|
204
|
+
/**
|
|
205
|
+
* Type/category of error
|
|
206
|
+
*
|
|
207
|
+
* Examples: 'InvalidConfig', 'ConfigParseError', 'EsmLoadingError',
|
|
208
|
+
* 'IifeLoadingError', 'ResourceLoadError'
|
|
209
|
+
*/
|
|
210
|
+
errorType: string;
|
|
211
|
+
/**
|
|
212
|
+
* Single item ID (if error relates to a specific item)
|
|
213
|
+
*/
|
|
214
|
+
itemId?: string;
|
|
215
|
+
/**
|
|
216
|
+
* Multiple item IDs (if error relates to multiple items)
|
|
217
|
+
*/
|
|
218
|
+
itemIds?: string[];
|
|
219
|
+
/**
|
|
220
|
+
* PIE element type (if error relates to a specific element)
|
|
221
|
+
*
|
|
222
|
+
* Examples: '@pie-element/inline-choice', '@pie-element/match'
|
|
223
|
+
*/
|
|
224
|
+
elementType?: string;
|
|
225
|
+
/**
|
|
226
|
+
* CDN base URL (for ESM loading errors)
|
|
227
|
+
*/
|
|
228
|
+
cdnBaseUrl?: string;
|
|
229
|
+
/**
|
|
230
|
+
* Bundle host URL (for IIFE loading errors)
|
|
231
|
+
*/
|
|
232
|
+
bundleHost?: string;
|
|
233
|
+
/**
|
|
234
|
+
* Resource URL (for resource loading errors)
|
|
235
|
+
*/
|
|
236
|
+
resourceUrl?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Resource type (for resource loading errors)
|
|
239
|
+
*
|
|
240
|
+
* Examples: 'img', 'audio', 'video', 'link', 'source'
|
|
241
|
+
*/
|
|
242
|
+
resourceType?: string;
|
|
243
|
+
/**
|
|
244
|
+
* Duration in milliseconds (for timing-related errors)
|
|
245
|
+
*/
|
|
246
|
+
duration?: number;
|
|
247
|
+
/**
|
|
248
|
+
* Retry count (for retry-related errors)
|
|
249
|
+
*/
|
|
250
|
+
retryCount?: number;
|
|
251
|
+
/**
|
|
252
|
+
* Whether retry was attempted (for resource errors)
|
|
253
|
+
*/
|
|
254
|
+
wasRetried?: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Extensible for additional context-specific attributes
|
|
257
|
+
*/
|
|
258
|
+
[key: string]: any;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Common event attributes
|
|
262
|
+
*
|
|
263
|
+
* These attributes are sent with event tracking calls.
|
|
264
|
+
*/
|
|
265
|
+
export interface EventAttributes {
|
|
266
|
+
/**
|
|
267
|
+
* Component that generated the event
|
|
268
|
+
*
|
|
269
|
+
* Optional - some events may be component-agnostic
|
|
270
|
+
*/
|
|
271
|
+
component?: string;
|
|
272
|
+
/**
|
|
273
|
+
* Timestamp of the event
|
|
274
|
+
*
|
|
275
|
+
* ISO 8601 format string
|
|
276
|
+
*/
|
|
277
|
+
timestamp?: string;
|
|
278
|
+
/**
|
|
279
|
+
* Resource URL
|
|
280
|
+
*/
|
|
281
|
+
url?: string;
|
|
282
|
+
/**
|
|
283
|
+
* Load duration in milliseconds
|
|
284
|
+
*/
|
|
285
|
+
duration?: number;
|
|
286
|
+
/**
|
|
287
|
+
* Transfer size in bytes
|
|
288
|
+
*/
|
|
289
|
+
size?: number;
|
|
290
|
+
/**
|
|
291
|
+
* Resource type
|
|
292
|
+
*
|
|
293
|
+
* Examples: 'img', 'audio', 'video', 'link', 'script', 'stylesheet'
|
|
294
|
+
*/
|
|
295
|
+
type?: string;
|
|
296
|
+
/**
|
|
297
|
+
* Resource type (alternative name for compatibility)
|
|
298
|
+
*/
|
|
299
|
+
resourceType?: string;
|
|
300
|
+
/**
|
|
301
|
+
* Whether the resource load failed
|
|
302
|
+
*/
|
|
303
|
+
failed?: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Whether retry was attempted
|
|
306
|
+
*/
|
|
307
|
+
wasRetried?: boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Retry count
|
|
310
|
+
*/
|
|
311
|
+
retryCount?: number;
|
|
312
|
+
/**
|
|
313
|
+
* Retry attempt number
|
|
314
|
+
*/
|
|
315
|
+
attempt?: number;
|
|
316
|
+
/**
|
|
317
|
+
* Delay before retry in milliseconds
|
|
318
|
+
*/
|
|
319
|
+
delay?: number;
|
|
320
|
+
/**
|
|
321
|
+
* Extensible for additional event-specific attributes
|
|
322
|
+
*/
|
|
323
|
+
[key: string]: any;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Metric attributes
|
|
327
|
+
*
|
|
328
|
+
* These attributes are sent with metric tracking calls.
|
|
329
|
+
*/
|
|
330
|
+
export interface MetricAttributes {
|
|
331
|
+
/**
|
|
332
|
+
* Unit of measurement
|
|
333
|
+
*
|
|
334
|
+
* Examples: 'ms', 'bytes', 'count', 'percent'
|
|
335
|
+
*/
|
|
336
|
+
unit?: string;
|
|
337
|
+
/**
|
|
338
|
+
* Category of metric
|
|
339
|
+
*
|
|
340
|
+
* Examples: 'performance', 'resource', 'error', 'user-action'
|
|
341
|
+
*/
|
|
342
|
+
category?: string;
|
|
343
|
+
/**
|
|
344
|
+
* Extensible for additional metric-specific attributes
|
|
345
|
+
*/
|
|
346
|
+
[key: string]: any;
|
|
347
|
+
}
|
|
348
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/instrumentation/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instrumentation Types
|
|
3
|
+
*
|
|
4
|
+
* Core interfaces and types for pluggable instrumentation system.
|
|
5
|
+
* Abstracts vendor-specific APIs (New Relic, DataDog, Dynatrace, etc.)
|
|
6
|
+
* to enable clients to use any instrumentation provider.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/instrumentation/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|