@interopio/otel 0.1.14 → 0.1.15
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/insights.d.ts +82 -7
- package/package.json +1 -1
package/insights.d.ts
CHANGED
|
@@ -146,7 +146,7 @@ export namespace IOInsights {
|
|
|
146
146
|
*
|
|
147
147
|
* Otherwise, if settings exist for a metric with this name, either provided
|
|
148
148
|
* by the platform or by configuration, a metric will be created.
|
|
149
|
-
*
|
|
149
|
+
*
|
|
150
150
|
* Otherwise, returns undefined.
|
|
151
151
|
*
|
|
152
152
|
* Subsequent calls to this method with the same name return the same metric.
|
|
@@ -158,11 +158,11 @@ export namespace IOInsights {
|
|
|
158
158
|
* Creates or retrieves a metric based on the provided settings.
|
|
159
159
|
*
|
|
160
160
|
* If a metric is already created with this name, it will be returned.
|
|
161
|
-
*
|
|
161
|
+
*
|
|
162
162
|
* Otherwise, if settings exist for a metric with this name, either provided
|
|
163
163
|
* by the platform or by configuration, they will be merged with the
|
|
164
164
|
* settings provided to this method before creating it.
|
|
165
|
-
*
|
|
165
|
+
*
|
|
166
166
|
* Otherwise, the settings provided will be used as is.
|
|
167
167
|
*
|
|
168
168
|
* Subsequent calls to this method with the same name return the same metric.
|
|
@@ -170,6 +170,57 @@ export namespace IOInsights {
|
|
|
170
170
|
* @param settings settings to use when creating the metric
|
|
171
171
|
*/
|
|
172
172
|
getFromSettings(settings: MetricSettings): Metric | undefined;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Creates or retrieves an observable metric by name.
|
|
176
|
+
*
|
|
177
|
+
* If a metric is already created with this name, it will be returned.
|
|
178
|
+
*
|
|
179
|
+
* Otherwise, if settings exist for a metric with this name, either provided
|
|
180
|
+
* by the platform or by configuration, a metric will be created.
|
|
181
|
+
*
|
|
182
|
+
* Otherwise, returns undefined.
|
|
183
|
+
*
|
|
184
|
+
* Subsequent calls to this method with the same name return the same metric.
|
|
185
|
+
*
|
|
186
|
+
* @param name the name of the metric, e.g. platform_startup
|
|
187
|
+
* @param observeCallback callback that provides the observable metric's value, invoked once per publishInterval
|
|
188
|
+
* @param subscribeCallback optional callback invoked when the metric is started, can be used to
|
|
189
|
+
* set up subscriptions if the metric is measuring event data
|
|
190
|
+
* @param unsubscribeCallback optional callback invoked when the metric is stopped, can be used to
|
|
191
|
+
* destroy subscriptions if the metric is measuring event data
|
|
192
|
+
*/
|
|
193
|
+
getObservable<TData extends Attributes>(
|
|
194
|
+
name: string,
|
|
195
|
+
observeCallback: (result: ObservableResult<TData>) => Promise<void>,
|
|
196
|
+
subscribeCallback?: () => Promise<void>,
|
|
197
|
+
unsubscribeCallback?: () => Promise<void>): Metric | undefined;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Creates or retrieves an observable metric based on the provided settings.
|
|
201
|
+
*
|
|
202
|
+
* If a metric is already created with this name, it will be returned.
|
|
203
|
+
*
|
|
204
|
+
* Otherwise, if settings exist for a metric with this name, either provided
|
|
205
|
+
* by the platform or by configuration, they will be merged with the
|
|
206
|
+
* settings provided to this method before creating it.
|
|
207
|
+
*
|
|
208
|
+
* Otherwise, the settings provided will be used as is.
|
|
209
|
+
*
|
|
210
|
+
* Subsequent calls to this method with the same name return the same metric.
|
|
211
|
+
*
|
|
212
|
+
* @param settings settings to use when creating the metric
|
|
213
|
+
* @param observeCallback callback that provides the observable metric's value, invoked once per publishInterval
|
|
214
|
+
* @param subscribeCallback optional callback invoked when the metric is started, can be used to
|
|
215
|
+
* set up subscriptions if the metric is measuring event data
|
|
216
|
+
* @param unsubscribeCallback optional callback invoked when the metric is stopped, can be used to
|
|
217
|
+
* destroy subscriptions if the metric is measuring event data
|
|
218
|
+
*/
|
|
219
|
+
getObservableFromSettings<TData extends Attributes>(
|
|
220
|
+
settings: IOInsights.MetricSettings,
|
|
221
|
+
observeCallback: (result: ObservableResult<TData>) => Promise<void>,
|
|
222
|
+
subscribeCallback?: () => Promise<void>,
|
|
223
|
+
unsubscribeCallback?: () => Promise<void>): Metric | undefined;
|
|
173
224
|
}
|
|
174
225
|
|
|
175
226
|
/**
|
|
@@ -379,7 +430,7 @@ export namespace IOInsights {
|
|
|
379
430
|
* Settings describing a metric.
|
|
380
431
|
*/
|
|
381
432
|
export interface MetricSettings {
|
|
382
|
-
enabled
|
|
433
|
+
enabled?: boolean;
|
|
383
434
|
type: MetricType;
|
|
384
435
|
name?: string;
|
|
385
436
|
description?: string;
|
|
@@ -1233,7 +1284,7 @@ export namespace IOInsights {
|
|
|
1233
1284
|
/**
|
|
1234
1285
|
* If `true`, io.Insights will instrument and trace the application startup process
|
|
1235
1286
|
* automatically.
|
|
1236
|
-
*
|
|
1287
|
+
*
|
|
1237
1288
|
* @default true
|
|
1238
1289
|
*/
|
|
1239
1290
|
instrumentAppStartup?: boolean;
|
|
@@ -1241,7 +1292,7 @@ export namespace IOInsights {
|
|
|
1241
1292
|
/**
|
|
1242
1293
|
* If `true`, io.Insights will instrument and trace the application loading process
|
|
1243
1294
|
* automatically.
|
|
1244
|
-
*
|
|
1295
|
+
*
|
|
1245
1296
|
* @default true
|
|
1246
1297
|
* @deprecated use instrumentAppStartup
|
|
1247
1298
|
*/
|
|
@@ -1842,11 +1893,29 @@ export namespace IOInsights {
|
|
|
1842
1893
|
/**
|
|
1843
1894
|
* If `true`, io.Insights will try to nest spans from other event listeners for the same event under
|
|
1844
1895
|
* the Clickstream span. This is not guaranteed to always work due to specifics of how browsers execute
|
|
1845
|
-
* event listeners, and will only work for listeners attached after io.Connect was initialized
|
|
1896
|
+
* event listeners, and will only work for listeners attached after io.Connect was initialized -
|
|
1897
|
+
* unless `nestEventHandlersEagerly` is also enabled.
|
|
1846
1898
|
*
|
|
1847
1899
|
* @default true
|
|
1848
1900
|
*/
|
|
1849
1901
|
nestEventListeners?: boolean;
|
|
1902
|
+
/**
|
|
1903
|
+
* If `true`, the io.Insights pre-init module (early.js, loaded from a preload script or an
|
|
1904
|
+
* inline snippet before the application code) eagerly patches addEventListener at page start,
|
|
1905
|
+
* so that listeners registered before io.Connect initialized also participate in
|
|
1906
|
+
* `nestEventListeners` nesting. Without it, only listeners attached after initialization
|
|
1907
|
+
* can be nested - and a listener that missed wrapping at registration stays unwrapped for
|
|
1908
|
+
* every later dispatch.
|
|
1909
|
+
*
|
|
1910
|
+
* The flag is read by the pre-init module itself from the platform-provided configuration
|
|
1911
|
+
* at `window.glue42gd.insights` (which mirrors this configuration object), so it has no
|
|
1912
|
+
* effect when the pre-init module is not installed or when running outside io.Connect
|
|
1913
|
+
* Desktop. The eager wrappers are inert pass-throughs until the SDK initializes, and remain
|
|
1914
|
+
* inert if the SDK loads with clickstream or `nestEventListeners` disabled.
|
|
1915
|
+
*
|
|
1916
|
+
* @default false
|
|
1917
|
+
*/
|
|
1918
|
+
nestEventHandlersEagerly?: boolean;
|
|
1850
1919
|
}
|
|
1851
1920
|
|
|
1852
1921
|
export interface RequestTraceConfig {
|
|
@@ -2390,16 +2459,22 @@ export namespace IOInsights {
|
|
|
2390
2459
|
|
|
2391
2460
|
/**
|
|
2392
2461
|
* Internal library property.
|
|
2462
|
+
*
|
|
2463
|
+
* @ignore
|
|
2393
2464
|
*/
|
|
2394
2465
|
definitiveInstance?: boolean;
|
|
2395
2466
|
|
|
2396
2467
|
/**
|
|
2397
2468
|
* Internal library property.
|
|
2469
|
+
*
|
|
2470
|
+
* @ignore
|
|
2398
2471
|
*/
|
|
2399
2472
|
platformInstance?: boolean;
|
|
2400
2473
|
|
|
2401
2474
|
/**
|
|
2402
2475
|
* Internal library property.
|
|
2476
|
+
*
|
|
2477
|
+
* @ignore
|
|
2403
2478
|
*/
|
|
2404
2479
|
registerControlMethods?: boolean;
|
|
2405
2480
|
|