@microsoft/applicationinsights-cfgsync-js 3.4.0-nightlybeta3.2505-36 → 3.4.0-nightlybeta3.2507-23
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/README.md +10 -10
- package/browser/es5/{ai.cfgsync.3.4.0-nightlybeta3.2505-36.cjs.js → ai.cfgsync.3.4.0-nightlybeta3.2507-23.cjs.js} +18 -19
- package/browser/es5/ai.cfgsync.3.4.0-nightlybeta3.2507-23.cjs.js.map +1 -0
- package/browser/es5/{ai.cfgsync.3.4.0-nightlybeta3.2505-36.cjs.min.js → ai.cfgsync.3.4.0-nightlybeta3.2507-23.cjs.min.js} +3 -3
- package/browser/es5/{ai.cfgsync.3.4.0-nightlybeta3.2505-36.cjs.min.js.map → ai.cfgsync.3.4.0-nightlybeta3.2507-23.cjs.min.js.map} +1 -1
- package/browser/es5/{ai.cfgsync.3.4.0-nightlybeta3.2505-36.gbl.js → ai.cfgsync.3.4.0-nightlybeta3.2507-23.gbl.js} +20 -21
- package/browser/es5/ai.cfgsync.3.4.0-nightlybeta3.2507-23.gbl.js.map +1 -0
- package/browser/es5/ai.cfgsync.3.4.0-nightlybeta3.2507-23.gbl.min.js +6 -0
- package/browser/es5/{ai.cfgsync.3.4.0-nightlybeta3.2505-36.gbl.min.js.map → ai.cfgsync.3.4.0-nightlybeta3.2507-23.gbl.min.js.map} +1 -1
- package/browser/es5/ai.cfgsync.3.4.0-nightlybeta3.2507-23.integrity.json +66 -0
- package/browser/es5/{ai.cfgsync.3.4.0-nightlybeta3.2505-36.js → ai.cfgsync.3.4.0-nightlybeta3.2507-23.js} +20 -21
- package/browser/es5/ai.cfgsync.3.4.0-nightlybeta3.2507-23.js.map +1 -0
- package/browser/es5/ai.cfgsync.3.4.0-nightlybeta3.2507-23.min.js +6 -0
- package/browser/es5/{ai.cfgsync.3.4.0-nightlybeta3.2505-36.min.js.map → ai.cfgsync.3.4.0-nightlybeta3.2507-23.min.js.map} +1 -1
- package/browser/es5/ai.cfgsync.3.cjs.js +17 -18
- package/browser/es5/ai.cfgsync.3.cjs.js.map +1 -1
- package/browser/es5/ai.cfgsync.3.cjs.min.js +2 -2
- package/browser/es5/ai.cfgsync.3.cjs.min.js.map +1 -1
- package/browser/es5/ai.cfgsync.3.gbl.js +19 -20
- package/browser/es5/ai.cfgsync.3.gbl.js.map +1 -1
- package/browser/es5/ai.cfgsync.3.gbl.min.js +2 -2
- package/browser/es5/ai.cfgsync.3.gbl.min.js.map +1 -1
- package/browser/es5/ai.cfgsync.3.integrity.json +25 -25
- package/browser/es5/ai.cfgsync.3.js +19 -20
- package/browser/es5/ai.cfgsync.3.js.map +1 -1
- package/browser/es5/ai.cfgsync.3.min.js +2 -2
- package/browser/es5/ai.cfgsync.3.min.js.map +1 -1
- package/dist/es5/applicationinsights-cfgsync-js.js +17 -18
- package/dist/es5/applicationinsights-cfgsync-js.js.map +1 -1
- package/dist/es5/applicationinsights-cfgsync-js.min.js +2 -2
- package/dist/es5/applicationinsights-cfgsync-js.min.js.map +1 -1
- package/dist-es5/CfgSyncHelperFuncs.js +1 -1
- package/dist-es5/CfgSyncPlugin.js +1 -1
- package/dist-es5/Interfaces/ICfgSyncCdnConfig.js +1 -1
- package/dist-es5/Interfaces/ICfgSyncConfig.js +1 -1
- package/dist-es5/Interfaces/ICfgSyncPlugin.js +1 -1
- package/dist-es5/__DynamicConstants.js +1 -1
- package/dist-es5/applicationinsights-cfgsync-js.js +1 -1
- package/package.json +3 -3
- package/types/applicationinsights-cfgsync-js.d.ts +1 -1
- package/types/applicationinsights-cfgsync-js.namespaced.d.ts +283 -14
- package/browser/es5/ai.cfgsync.3.4.0-nightlybeta3.2505-36.cjs.js.map +0 -1
- package/browser/es5/ai.cfgsync.3.4.0-nightlybeta3.2505-36.gbl.js.map +0 -1
- package/browser/es5/ai.cfgsync.3.4.0-nightlybeta3.2505-36.gbl.min.js +0 -6
- package/browser/es5/ai.cfgsync.3.4.0-nightlybeta3.2505-36.integrity.json +0 -66
- package/browser/es5/ai.cfgsync.3.4.0-nightlybeta3.2505-36.js.map +0 -1
- package/browser/es5/ai.cfgsync.3.4.0-nightlybeta3.2505-36.min.js +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Properties Plugin, 3.4.0-nightlybeta3.
|
|
2
|
+
* Application Insights JavaScript SDK - Properties Plugin, 3.4.0-nightlybeta3.2507-23
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
import { isNullOrUndefined, isObject, objExtend, objForEachKey, setValueByKey } from "@nevware21/ts-utils";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Properties Plugin, 3.4.0-nightlybeta3.
|
|
2
|
+
* Application Insights JavaScript SDK - Properties Plugin, 3.4.0-nightlybeta3.2507-23
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
import { CfgSyncPlugin } from "./CfgSyncPlugin";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/applicationinsights-cfgsync-js",
|
|
3
|
-
"version": "3.4.0-nightlybeta3.
|
|
3
|
+
"version": "3.4.0-nightlybeta3.2507-23",
|
|
4
4
|
"description": "Microsoft Application Insights CfgSync Plugin",
|
|
5
5
|
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
6
6
|
"author": "Microsoft Application Insights Team",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@microsoft/dynamicproto-js": "^2.0.3",
|
|
59
59
|
"@microsoft/applicationinsights-shims": "3.0.1",
|
|
60
|
-
"@microsoft/applicationinsights-core-js": "3.4.0-nightlybeta3.
|
|
61
|
-
"@microsoft/applicationinsights-common": "3.4.0-nightlybeta3.
|
|
60
|
+
"@microsoft/applicationinsights-core-js": "3.4.0-nightlybeta3.2507-23",
|
|
61
|
+
"@microsoft/applicationinsights-common": "3.4.0-nightlybeta3.2507-23",
|
|
62
62
|
"@nevware21/ts-utils": ">= 0.11.8 < 2.x",
|
|
63
63
|
"@nevware21/ts-async": ">= 0.5.4 < 2.x"
|
|
64
64
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights idsync plugin, 3.4.0-nightlybeta3.
|
|
2
|
+
* Microsoft Application Insights idsync plugin, 3.4.0-nightlybeta3.2507-23
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -29,9 +29,12 @@ declare namespace ApplicationInsights {
|
|
|
29
29
|
*/
|
|
30
30
|
processNext: (env: ITelemetryItem, itemCtx: IProcessTelemetryContext) => void;
|
|
31
31
|
/**
|
|
32
|
-
* Set next extension for telemetry processing
|
|
32
|
+
* Set next extension for telemetry processing, this is now optional as plugins should use the
|
|
33
|
+
* processNext() function of the passed IProcessTelemetryContext instead. It is being kept for
|
|
34
|
+
* now for backward compatibility only.
|
|
35
|
+
* @deprecated - Use processNext() function of the passed IProcessTelemetryContext instead
|
|
33
36
|
*/
|
|
34
|
-
setNextPlugin
|
|
37
|
+
setNextPlugin?: (next: ITelemetryPlugin | ITelemetryPluginChain) => void;
|
|
35
38
|
/**
|
|
36
39
|
* Returns the current diagnostic logger that can be used to log issues, if no logger is currently
|
|
37
40
|
* assigned a new default one will be created and returned.
|
|
@@ -167,17 +170,78 @@ declare namespace ApplicationInsights {
|
|
|
167
170
|
|
|
168
171
|
const enum eDistributedTracingModes {
|
|
169
172
|
/**
|
|
170
|
-
*
|
|
173
|
+
* Send only the legacy Application Insights correlation headers
|
|
174
|
+
*
|
|
175
|
+
* Headers Sent:
|
|
176
|
+
* - `Request-Id` (Legacy Application Insights header for older Server side SDKs)
|
|
177
|
+
*
|
|
178
|
+
* Config Decimal Value: `0` (Zero)
|
|
171
179
|
*/
|
|
172
180
|
AI = 0,
|
|
173
181
|
/**
|
|
174
|
-
* Send both W3C Trace
|
|
182
|
+
* (Default) Send both W3C Trace parent header and back-compatibility Application Insights headers
|
|
183
|
+
* - `Request-Id`
|
|
184
|
+
* - [`traceparent`](https://www.w3.org/TR/trace-context/#traceparent-header)
|
|
185
|
+
*
|
|
186
|
+
* Config Decimal Value: `1` (One)
|
|
175
187
|
*/
|
|
176
188
|
AI_AND_W3C = 1,
|
|
177
189
|
/**
|
|
178
|
-
* Send W3C Trace
|
|
190
|
+
* Send Only the W3C Trace parent header
|
|
191
|
+
*
|
|
192
|
+
* Headers Sent:
|
|
193
|
+
* - [`traceparent`](https://www.w3.org/TR/trace-context/#traceparent-header)
|
|
194
|
+
*
|
|
195
|
+
* Config Decimal Value: `2` (Two)
|
|
196
|
+
*/
|
|
197
|
+
W3C = 2,
|
|
198
|
+
/**
|
|
199
|
+
* @internal
|
|
200
|
+
* Bitwise mask used to separate the base distributed tracing mode from the additional optional
|
|
201
|
+
* tracing modes.
|
|
202
|
+
* @since 3.4.0
|
|
179
203
|
*/
|
|
180
|
-
|
|
204
|
+
_BaseMask = 15,
|
|
205
|
+
/**
|
|
206
|
+
* @internal
|
|
207
|
+
* Enabling this bit will send the W3C Trace State header, it is not intended to be used directly
|
|
208
|
+
* or on its own. The code may assume that if this bit is set, then the W3C Trace Context headers
|
|
209
|
+
* will also be included.
|
|
210
|
+
*
|
|
211
|
+
* Config Decimal Value: `16` (Sixteen in decimal)
|
|
212
|
+
* @since 3.4.0
|
|
213
|
+
*/
|
|
214
|
+
_W3CTraceState = 16,
|
|
215
|
+
/**
|
|
216
|
+
* Send all of the W3C Trace Context headers and the W3C Trace State headers and back-compatibility
|
|
217
|
+
* Application Insights headers.
|
|
218
|
+
*
|
|
219
|
+
* Currently sent headers:
|
|
220
|
+
* - `Request-Id` (Legacy Application Insights header for older Server side SDKs)
|
|
221
|
+
* - [`traceparent`](https://www.w3.org/TR/trace-context/#traceparent-header)
|
|
222
|
+
* - [`tracestate`](https://www.w3.org/TR/trace-context/#tracestate-header)
|
|
223
|
+
*
|
|
224
|
+
* NOTE!: Additional headers may be added as part of a future update should the W3C Trace Context specification be updated
|
|
225
|
+
* to include additional headers.
|
|
226
|
+
*
|
|
227
|
+
* Config Decimal Value: `17` (Seventeen in decimal)
|
|
228
|
+
* @since 3.4.0
|
|
229
|
+
*/
|
|
230
|
+
AI_AND_W3C_TRACE = 17,
|
|
231
|
+
/**
|
|
232
|
+
* Send all of the W3C Trace Context headers and the W3C Trace State headers.
|
|
233
|
+
*
|
|
234
|
+
* Currently sent headers:
|
|
235
|
+
* - [`traceparent`](https://www.w3.org/TR/trace-context/#traceparent-header)
|
|
236
|
+
* - [`tracestate`](https://www.w3.org/TR/trace-context/#tracestate-header)
|
|
237
|
+
*
|
|
238
|
+
* NOTE!: Additional headers may be added as part of a future update should the W3C Trace Context specification be updated
|
|
239
|
+
* to include additional headers.
|
|
240
|
+
*
|
|
241
|
+
* Config Decimal Value: `18` (Eighteen in decimal)
|
|
242
|
+
* @since 3.4.0
|
|
243
|
+
*/
|
|
244
|
+
W3C_TRACE = 18
|
|
181
245
|
}
|
|
182
246
|
|
|
183
247
|
const enum _eInternalMessageId {
|
|
@@ -310,6 +374,30 @@ declare namespace ApplicationInsights {
|
|
|
310
374
|
|
|
311
375
|
type EnumValue<E = any> = EnumCls<E>;
|
|
312
376
|
|
|
377
|
+
/**
|
|
378
|
+
* Controls how the SDK should look for trace headers (traceparent/tracestate) from the initial page load
|
|
379
|
+
* The values are bitwise OR'd together to allow for multiple values to be set at once.
|
|
380
|
+
* @since 3.4.0
|
|
381
|
+
*/
|
|
382
|
+
const enum eTraceHeadersMode {
|
|
383
|
+
/**
|
|
384
|
+
* Don't look for any trace headers
|
|
385
|
+
*/
|
|
386
|
+
None = 0,
|
|
387
|
+
/**
|
|
388
|
+
* Look for traceparent header/meta tag
|
|
389
|
+
*/
|
|
390
|
+
TraceParent = 1,
|
|
391
|
+
/**
|
|
392
|
+
* Look for tracestate header/meta tag
|
|
393
|
+
*/
|
|
394
|
+
TraceState = 2,
|
|
395
|
+
/**
|
|
396
|
+
* Look for both traceparent and tracestate headers/meta tags
|
|
397
|
+
*/
|
|
398
|
+
All = 3
|
|
399
|
+
}
|
|
400
|
+
|
|
313
401
|
const enum FeatureOptInMode {
|
|
314
402
|
/**
|
|
315
403
|
* not set, completely depends on cdn cfg
|
|
@@ -452,7 +540,7 @@ declare namespace ApplicationInsights {
|
|
|
452
540
|
*/
|
|
453
541
|
flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void;
|
|
454
542
|
/**
|
|
455
|
-
* Gets the current distributed trace context for this instance
|
|
543
|
+
* Gets the current distributed trace active context for this instance
|
|
456
544
|
* @param createNew - Optional flag to create a new instance if one doesn't currently exist, defaults to true
|
|
457
545
|
*/
|
|
458
546
|
getTraceCtx(createNew?: boolean): IDistributedTraceContext | null;
|
|
@@ -501,9 +589,12 @@ declare namespace ApplicationInsights {
|
|
|
501
589
|
*/
|
|
502
590
|
getCfg: () => IConfiguration;
|
|
503
591
|
/**
|
|
504
|
-
* Gets the named extension
|
|
592
|
+
* Gets the named extension configuration
|
|
593
|
+
* @param identifier - The named extension identifier
|
|
594
|
+
* @param defaultValue - The default value(s) to return if no defined config exists
|
|
595
|
+
* @param rootOnly - If true, only the look for the configuration in the top level and not in the "extensionConfig"
|
|
505
596
|
*/
|
|
506
|
-
getExtCfg: <T>(identifier: string, defaultValue?: IConfigDefaults<T
|
|
597
|
+
getExtCfg: <T>(identifier: string, defaultValue?: IConfigDefaults<T>, rootOnly?: boolean) => T;
|
|
507
598
|
/**
|
|
508
599
|
* Gets the named config from either the named identifier extension or core config if neither exist then the
|
|
509
600
|
* default value is returned
|
|
@@ -1241,7 +1332,7 @@ declare namespace ApplicationInsights {
|
|
|
1241
1332
|
* }
|
|
1242
1333
|
* ```
|
|
1243
1334
|
*
|
|
1244
|
-
* For more details, see the [Page Unload Events documentation](https://microsoft.github.io/ApplicationInsights-JS/
|
|
1335
|
+
* For more details, see the [Page Unload Events documentation](https://microsoft.github.io/ApplicationInsights-JS/PageUnloadEvents.html).
|
|
1245
1336
|
*/
|
|
1246
1337
|
disablePageUnloadEvents?: string[];
|
|
1247
1338
|
/**
|
|
@@ -1256,7 +1347,7 @@ declare namespace ApplicationInsights {
|
|
|
1256
1347
|
* }
|
|
1257
1348
|
* ```
|
|
1258
1349
|
*
|
|
1259
|
-
* For more details, see the [Page Unload Events documentation](https://microsoft.github.io/ApplicationInsights-JS/
|
|
1350
|
+
* For more details, see the [Page Unload Events documentation](https://microsoft.github.io/ApplicationInsights-JS/PageUnloadEvents.html).
|
|
1260
1351
|
*/
|
|
1261
1352
|
disablePageShowEvents?: string[];
|
|
1262
1353
|
/**
|
|
@@ -1298,6 +1389,25 @@ declare namespace ApplicationInsights {
|
|
|
1298
1389
|
* @since 3.3.2
|
|
1299
1390
|
*/
|
|
1300
1391
|
expCfg?: IExceptionConfig;
|
|
1392
|
+
/**
|
|
1393
|
+
* [Optional] A flag to enable or disable the use of the field redaction for urls.
|
|
1394
|
+
* @defaultValue true
|
|
1395
|
+
*/
|
|
1396
|
+
redactUrls?: boolean;
|
|
1397
|
+
/**
|
|
1398
|
+
* [Optional] Additional query parameters to redact beyond the default set.
|
|
1399
|
+
* Use this to specify custom parameters that contain sensitive information.
|
|
1400
|
+
* These will be combined with the default parameters that are redacted.
|
|
1401
|
+
* @defaultValue ["sig", "Signature", "AWSAccessKeyId", "X-Goog-Signature"]
|
|
1402
|
+
* @example ["sig", "Signature", "AWSAccessKeyId", "X-Goog-Signature","auth_token", "api_key", "private_data"]
|
|
1403
|
+
*/
|
|
1404
|
+
redactQueryParams?: string[];
|
|
1405
|
+
/**
|
|
1406
|
+
* [Optional] Controls if the SDK should look for the `traceparent` and/or `tracestate` values from
|
|
1407
|
+
* the service timing headers or meta tags from the initial page load.
|
|
1408
|
+
* @defaultValue eTraceHeadersMode.All
|
|
1409
|
+
*/
|
|
1410
|
+
traceHdrMode?: eTraceHeadersMode;
|
|
1301
1411
|
}
|
|
1302
1412
|
|
|
1303
1413
|
interface ICookieMgr {
|
|
@@ -1478,8 +1588,13 @@ declare namespace ApplicationInsights {
|
|
|
1478
1588
|
*/
|
|
1479
1589
|
getName(): string;
|
|
1480
1590
|
/**
|
|
1481
|
-
* Sets the current name of the page
|
|
1591
|
+
* Sets the current name of the page, also updates the name for any parent context.
|
|
1592
|
+
* This is used to identify the page in the telemetry data.
|
|
1593
|
+
* @remarks This function updates the current and ALL parent contexts with the new name,
|
|
1594
|
+
* to just update the name of the current context, use the `pageName` property.
|
|
1482
1595
|
* @param pageName - The name of the page
|
|
1596
|
+
* @deprecated Use the `pageName` property to avoid the side effect of changing the page name of all
|
|
1597
|
+
* parent contexts.
|
|
1483
1598
|
*/
|
|
1484
1599
|
setName(pageName: string): void;
|
|
1485
1600
|
/**
|
|
@@ -1492,6 +1607,12 @@ declare namespace ApplicationInsights {
|
|
|
1492
1607
|
* Set the unique identifier for a trace. All requests / spans from the same trace share the same traceId.
|
|
1493
1608
|
* Must be conform to the W3C TraceContext specification, in a hex representation of 16-byte array.
|
|
1494
1609
|
* A.k.a. trace-id, TraceID or Distributed TraceID https://www.w3.org/TR/trace-context/#trace-id
|
|
1610
|
+
*
|
|
1611
|
+
* @remarks Sets the traceId for the current context AND all parent contexts, if you want to set the traceId
|
|
1612
|
+
* for the current context only, use the `traceId` property.
|
|
1613
|
+
* @param newValue - The traceId to set
|
|
1614
|
+
* @deprecated Use the `traceId` property to avoid the side effect of changing the traceId of all
|
|
1615
|
+
* parent contexts.
|
|
1495
1616
|
*/
|
|
1496
1617
|
setTraceId(newValue: string): void;
|
|
1497
1618
|
/**
|
|
@@ -1503,6 +1624,12 @@ declare namespace ApplicationInsights {
|
|
|
1503
1624
|
* Self-generated 8-bytes identifier of the incoming request. Must be a hex representation of 8-byte array.
|
|
1504
1625
|
* Also know as the parentId, used to link requests together
|
|
1505
1626
|
* https://www.w3.org/TR/trace-context/#parent-id
|
|
1627
|
+
*
|
|
1628
|
+
* @remarks Sets the spanId for the current context AND all parent contexts, if you want to set the spanId for
|
|
1629
|
+
* the current context only, use the `spanId` property.
|
|
1630
|
+
* @param newValue - The spanId to set
|
|
1631
|
+
* @deprecated Use the `spanId` property to avoid the side effect of changing the spanId of all
|
|
1632
|
+
* parent contexts.
|
|
1506
1633
|
*/
|
|
1507
1634
|
setSpanId(newValue: string): void;
|
|
1508
1635
|
/**
|
|
@@ -1511,9 +1638,80 @@ declare namespace ApplicationInsights {
|
|
|
1511
1638
|
getTraceFlags(): number | undefined;
|
|
1512
1639
|
/**
|
|
1513
1640
|
* https://www.w3.org/TR/trace-context/#trace-flags
|
|
1641
|
+
* @remarks Sets the trace flags for the current context and ALL parent contexts, if you want to set the trace
|
|
1642
|
+
* flags for the current context only, use the `traceFlags` property.
|
|
1514
1643
|
* @param newValue - An integer representation of the W3C TraceContext trace-flags.
|
|
1644
|
+
* @deprecated Use the `traceFlags` property to avoid the side effect of changing the traceFlags of all
|
|
1645
|
+
* parent contexts.
|
|
1515
1646
|
*/
|
|
1516
1647
|
setTraceFlags(newValue?: number): void;
|
|
1648
|
+
/**
|
|
1649
|
+
* Returns the current name of the page
|
|
1650
|
+
* @remarks This function updates the current context only, to update the name of the current and ALL parent contexts,
|
|
1651
|
+
* use the `setName` method.
|
|
1652
|
+
* @default undefined
|
|
1653
|
+
* @since 3.4.0
|
|
1654
|
+
*/
|
|
1655
|
+
pageName: string;
|
|
1656
|
+
/**
|
|
1657
|
+
* The current ID of the trace that this span belongs to. It is worldwide unique
|
|
1658
|
+
* with practically sufficient probability by being made as 16 randomly
|
|
1659
|
+
* generated bytes, encoded as a 32 lowercase hex characters corresponding to
|
|
1660
|
+
* 128 bits.
|
|
1661
|
+
* @remarks If you update this value, it will only update for the current context, not the parent context,
|
|
1662
|
+
* if you need to update the current and ALL parent contexts, use the `setTraceId` method.
|
|
1663
|
+
* @since 3.4.0
|
|
1664
|
+
*/
|
|
1665
|
+
traceId: string;
|
|
1666
|
+
/**
|
|
1667
|
+
* The ID of the Span. It is globally unique with practically sufficient
|
|
1668
|
+
* probability by being made as 8 randomly generated bytes, encoded as a 16
|
|
1669
|
+
* lowercase hex characters corresponding to 64 bits.
|
|
1670
|
+
* If you update this value, it will only update for the current context, not the parent context.
|
|
1671
|
+
* @remarks If you update this value, it will only update for the current context, not the parent context,
|
|
1672
|
+
* if you need to update the current and ALL parent contexts, use the `setSpanId` method.
|
|
1673
|
+
* @since 3.4.0
|
|
1674
|
+
*/
|
|
1675
|
+
spanId: string;
|
|
1676
|
+
/**
|
|
1677
|
+
* Returns true if the current context was initialized (propagated) from a remote parent.
|
|
1678
|
+
* @since 3.4.0
|
|
1679
|
+
* @default false
|
|
1680
|
+
* @returns True if the context was propagated from a remote parent
|
|
1681
|
+
*/
|
|
1682
|
+
readonly isRemote: boolean;
|
|
1683
|
+
/**
|
|
1684
|
+
* Trace flags to propagate.
|
|
1685
|
+
*
|
|
1686
|
+
* It is represented as 1 byte (bitmap). Bit to represent whether trace is
|
|
1687
|
+
* sampled or not. When set, the least significant bit documents that the
|
|
1688
|
+
* caller may have recorded trace data. A caller who does not record trace
|
|
1689
|
+
* data out-of-band leaves this flag unset.
|
|
1690
|
+
*
|
|
1691
|
+
* see {@link eW3CTraceFlags} for valid flag values.
|
|
1692
|
+
*
|
|
1693
|
+
* @remarks If you update this value, it will only update for the current context, not the parent context,
|
|
1694
|
+
* if you need to update the current and ALL parent contexts, use the `setTraceFlags` method.
|
|
1695
|
+
* @since 3.4.0
|
|
1696
|
+
*/
|
|
1697
|
+
traceFlags?: number;
|
|
1698
|
+
/**
|
|
1699
|
+
* Returns the current trace state which will be used to propgate context across different services.
|
|
1700
|
+
* Updating (adding / removing keys) of the trace state will modify the current context.
|
|
1701
|
+
* @remarks Unlike the OpenTelemetry {@link TraceState}, this value is a mutable object, so you can
|
|
1702
|
+
* modify it directly you do not need to reassign the new value to this property.
|
|
1703
|
+
* @since 3.4.0
|
|
1704
|
+
*/
|
|
1705
|
+
readonly traceState: IW3cTraceState;
|
|
1706
|
+
/**
|
|
1707
|
+
* Provides access to the parent context of the current context.
|
|
1708
|
+
* @remarks This is a read-only property, you cannot modify the parent context directly, you can only
|
|
1709
|
+
* modify the current context. If you need to modify the parent context, you need to do it through the
|
|
1710
|
+
* current context using the `setTraceId`, `setSpanId`, `setTraceFlags` and `setName` methods.
|
|
1711
|
+
* @default null
|
|
1712
|
+
* @since 3.4.0
|
|
1713
|
+
*/
|
|
1714
|
+
readonly parentCtx?: IDistributedTraceContext | null;
|
|
1517
1715
|
}
|
|
1518
1716
|
|
|
1519
1717
|
/**
|
|
@@ -2286,9 +2484,10 @@ declare namespace ApplicationInsights {
|
|
|
2286
2484
|
*/
|
|
2287
2485
|
interface ITelemetryPlugin extends ITelemetryProcessor, IPlugin {
|
|
2288
2486
|
/**
|
|
2289
|
-
* Set next extension for telemetry processing, this is
|
|
2487
|
+
* Set next extension for telemetry processing, this is now optional as plugins should use the
|
|
2290
2488
|
* processNext() function of the passed IProcessTelemetryContext instead. It is being kept for
|
|
2291
2489
|
* now for backward compatibility only.
|
|
2490
|
+
* @deprecated - Use processNext() function of the passed IProcessTelemetryContext instead
|
|
2292
2491
|
*/
|
|
2293
2492
|
setNextPlugin?: (next: ITelemetryPlugin | ITelemetryPluginChain) => void;
|
|
2294
2493
|
/**
|
|
@@ -2570,6 +2769,76 @@ declare namespace ApplicationInsights {
|
|
|
2570
2769
|
run: (logger?: IDiagnosticLogger) => void;
|
|
2571
2770
|
}
|
|
2572
2771
|
|
|
2772
|
+
/**
|
|
2773
|
+
* Represents a mutable [W3C trace state list](https://www.w3.org/TR/trace-context/#tracestate-header), this is a
|
|
2774
|
+
* list of key/value pairs that are used to pass trace state information between different tracing systems. The
|
|
2775
|
+
* list is ordered and the order is important as it determines the processing order.
|
|
2776
|
+
*
|
|
2777
|
+
* Importantly instances of this type are mutable, change made to an instance via {@link IW3cTraceState.set} or
|
|
2778
|
+
* {@link IW3cTraceState.del} will be reflected on the instance and any child instances that use it as a parent.
|
|
2779
|
+
* However, any parent instance associated with an instance will not be modified by operations on that particular
|
|
2780
|
+
* instance.
|
|
2781
|
+
*
|
|
2782
|
+
* @since 3.4.0
|
|
2783
|
+
*/
|
|
2784
|
+
interface IW3cTraceState {
|
|
2785
|
+
/**
|
|
2786
|
+
* Returns a readonly array of the current keys associated with the trace state, keys are returned in the
|
|
2787
|
+
* required processing order and if this instance has a parent the keys from the parent will be included
|
|
2788
|
+
* unless they have been removed (deleted) from the child instance.
|
|
2789
|
+
* Once created any modifications to the parent will also be reflected in the child, this is different from
|
|
2790
|
+
* the OpenTelemetry implementation which creates a new instance for each call.
|
|
2791
|
+
* @returns A readonly array of the current keys associated with the trace state
|
|
2792
|
+
*/
|
|
2793
|
+
readonly keys: string[];
|
|
2794
|
+
/**
|
|
2795
|
+
* Check if the trace state list is empty, meaning it has no keys or values.
|
|
2796
|
+
* This exists to allow for quick checks without needing to create a new array of keys.
|
|
2797
|
+
* @since 3.4.0
|
|
2798
|
+
* @returns true if the trace state list is empty, false otherwise
|
|
2799
|
+
*/
|
|
2800
|
+
readonly isEmpty: boolean;
|
|
2801
|
+
/**
|
|
2802
|
+
* Get the value for the specified key that is associated with this instance, either directly or from the parent.
|
|
2803
|
+
* @param key - The key to lookup
|
|
2804
|
+
* @returns The value for the key, or undefined if not found
|
|
2805
|
+
*/
|
|
2806
|
+
get(key: string): string | undefined;
|
|
2807
|
+
/**
|
|
2808
|
+
* Set the value for the specified key for this instance, returning its new location within the list.
|
|
2809
|
+
* - 0 is the front of the list
|
|
2810
|
+
* - -1 not set because the key/value pair is invalid
|
|
2811
|
+
* If the key already exists it will be removed from its current location and added to the front of the list. And
|
|
2812
|
+
* if the key was in the parent this will override the value inherited from the parent, more importantly it will
|
|
2813
|
+
* not modify the parent value.
|
|
2814
|
+
* @param key - The key to set
|
|
2815
|
+
* @param value - The value to set
|
|
2816
|
+
* @returns 0 if successful, -1 if not
|
|
2817
|
+
*/
|
|
2818
|
+
set(key: string, value: string): number;
|
|
2819
|
+
/**
|
|
2820
|
+
* Delete the specified key from this instance, if the key was in the parent it will be removed (hidden) from
|
|
2821
|
+
* this instance but will still be available directly from the parent.
|
|
2822
|
+
* @param key - The key to delete
|
|
2823
|
+
*/
|
|
2824
|
+
del(key: string): void;
|
|
2825
|
+
/**
|
|
2826
|
+
* Format the trace state list into a strings where each string can be used as a header value.
|
|
2827
|
+
* This will return an empty array if the trace state list is empty.
|
|
2828
|
+
* @param maxHeaders - The maximum number of entries to include in the output, once the limit is reached no more entries will be included
|
|
2829
|
+
* @param maxKeys - The maximum number of keys to include in the output, once the limit is reached no more keys will be included
|
|
2830
|
+
* @param maxLen - The maximum length of each header value, once the limit is reached a new header value will be created
|
|
2831
|
+
* @returns An array of strings that can be used for the header values, if the trace state list is empty an empty array will be returned
|
|
2832
|
+
*/
|
|
2833
|
+
hdrs(maxHeaders?: number, maxKeys?: number, maxLen?: number): string[];
|
|
2834
|
+
/**
|
|
2835
|
+
* Create a new instance of IW3cTraceState which is a child of this instance, meaning it will inherit the keys
|
|
2836
|
+
* and values from this instance but any changes made to the child will not affect this instance.
|
|
2837
|
+
* @returns A new instance of IW3cTraceState which is a child of this instance
|
|
2838
|
+
*/
|
|
2839
|
+
child(): IW3cTraceState;
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2573
2842
|
interface IWatchDetails<T = IConfiguration> {
|
|
2574
2843
|
/**
|
|
2575
2844
|
* The current config object
|