@interopio/otel 0.0.218 → 0.0.220
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/traces/builder.d.ts +2 -1
- package/dist/traces/builder.js +16 -5
- package/dist/traces/builder.js.map +1 -1
- package/insights.d.ts +399 -53
- package/package.json +3 -3
package/dist/traces/builder.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TracerProvider } from "@opentelemetry/api";
|
|
1
|
+
import { ContextManager, type TracerProvider } from "@opentelemetry/api";
|
|
2
2
|
import { IOInsights } from "../../insights";
|
|
3
3
|
import { PropagationInfo } from "..";
|
|
4
4
|
export declare class TracesManagerBuilder implements IOInsights.TracesManagerBuilder {
|
|
@@ -14,6 +14,7 @@ export declare class TracesManagerBuilder implements IOInsights.TracesManagerBui
|
|
|
14
14
|
withSettings(settings: IOInsights.Settings): this;
|
|
15
15
|
withMetrics(metrics: IOInsights.MetricsManager): this;
|
|
16
16
|
withTracerProvider(tracerProvider: TracerProvider): this;
|
|
17
|
+
withContextManager(contextManager: ContextManager): this;
|
|
17
18
|
withPropagationInfoStorage(store: (source: string, pi: PropagationInfo) => Promise<void>, read: (source: string) => Promise<PropagationInfo | null>): this;
|
|
18
19
|
build(): IOInsights.TracesManager;
|
|
19
20
|
private buildCore;
|
package/dist/traces/builder.js
CHANGED
|
@@ -27,6 +27,14 @@ class TracesManagerBuilder {
|
|
|
27
27
|
this.tracerProvider = tracerProvider;
|
|
28
28
|
return this;
|
|
29
29
|
}
|
|
30
|
+
withContextManager(contextManager) {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
this.settings = (_a = this.settings) !== null && _a !== void 0 ? _a : { enabled: false };
|
|
33
|
+
this.settings.traces = (_b = this.settings.traces) !== null && _b !== void 0 ? _b : { enabled: false };
|
|
34
|
+
this.settings.traces.contextManager = () => contextManager;
|
|
35
|
+
this.settings.traces.useOTELContextManager = true;
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
30
38
|
withPropagationInfoStorage(store, read) {
|
|
31
39
|
this.store = store;
|
|
32
40
|
this.read = read;
|
|
@@ -47,14 +55,17 @@ class TracesManagerBuilder {
|
|
|
47
55
|
return toReturn;
|
|
48
56
|
}
|
|
49
57
|
buildCore() {
|
|
50
|
-
var _a, _b, _c, _d, _e;
|
|
58
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
59
|
+
this.settings.traces = (_a = this.settings.traces) !== null && _a !== void 0 ? _a : { enabled: false };
|
|
60
|
+
this.settings.traces.otlpExporterConfig = (_b = this.settings.traces.exporterSettings) !== null && _b !== void 0 ? _b : this.settings.traces.otlpExporterConfig;
|
|
61
|
+
this.settings.traces.exporterSettings = (_c = this.settings.traces.exporterSettings) !== null && _c !== void 0 ? _c : this.settings.traces.otlpExporterConfig;
|
|
51
62
|
let tracePlugin;
|
|
52
|
-
if (((
|
|
53
|
-
((
|
|
63
|
+
if (((_d = this.settings) === null || _d === void 0 ? void 0 : _d.enabled) !== true ||
|
|
64
|
+
((_f = (_e = this.settings) === null || _e === void 0 ? void 0 : _e.traces) === null || _f === void 0 ? void 0 : _f.enabled) !== true ||
|
|
54
65
|
!(tracePlugin = (0, __1.loadInsightsPlugin)("traces", this.logger))) {
|
|
55
|
-
return new nullTracesManager_1.NullTracesManager((
|
|
66
|
+
return new nullTracesManager_1.NullTracesManager((_g = this.settings) === null || _g === void 0 ? void 0 : _g.traces, this.settings, this.logger);
|
|
56
67
|
}
|
|
57
|
-
const manager = tracePlugin.newTracesManager(this.logger, this.settings, (
|
|
68
|
+
const manager = tracePlugin.newTracesManager(this.logger, this.settings, (_h = this.traceLogger) !== null && _h !== void 0 ? _h : this.logger, this.metrics, this.store, this.read);
|
|
58
69
|
return manager;
|
|
59
70
|
}
|
|
60
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/traces/builder.ts"],"names":[],"mappings":";;;AACA,2DAAwD;AAGxD,0BAAgG;AAIhG,MAAa,oBAAoB;IAAjC;QAES,gBAAW,GAA6B,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/traces/builder.ts"],"names":[],"mappings":"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"}
|
package/insights.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
} from "@opentelemetry/sdk-logs";
|
|
40
40
|
import { MeterProvider, MeterProviderOptions, type MetricReader, type PeriodicExportingMetricReaderOptions, type PushMetricExporter } from "@opentelemetry/sdk-metrics";
|
|
41
41
|
import { type OTLPMetricExporterOptions } from "@opentelemetry/exporter-metrics-otlp-http";
|
|
42
|
+
import { deprecate } from "util";
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
45
|
* @docname Insights
|
|
@@ -49,17 +50,17 @@ import { type OTLPMetricExporterOptions } from "@opentelemetry/exporter-metrics-
|
|
|
49
50
|
export namespace IOInsights {
|
|
50
51
|
export interface API extends Manager<Settings> {
|
|
51
52
|
/**
|
|
52
|
-
* io.insights.metrics
|
|
53
|
+
* io.insights Metrics API, often accessible as io.insights.metrics
|
|
53
54
|
*/
|
|
54
55
|
metrics: MetricsManager;
|
|
55
56
|
|
|
56
57
|
/**
|
|
57
|
-
* io.insights.traces
|
|
58
|
+
* io.insights Traces API, often accessible as io.insights.traces
|
|
58
59
|
*/
|
|
59
60
|
traces: TracesManager;
|
|
60
61
|
|
|
61
62
|
/**
|
|
62
|
-
* io.insights.logs
|
|
63
|
+
* io.insights Logs API, often accessible as io.insights.logs
|
|
63
64
|
*/
|
|
64
65
|
logs: LogsManager;
|
|
65
66
|
}
|
|
@@ -125,9 +126,42 @@ export namespace IOInsights {
|
|
|
125
126
|
* Metrics API.
|
|
126
127
|
*/
|
|
127
128
|
export interface MetricsManager extends Manager<MetricsSettings> {
|
|
128
|
-
|
|
129
|
+
/**
|
|
130
|
+
* Creates or retrieves a metric by name.
|
|
131
|
+
*
|
|
132
|
+
* If a metric is already created with this name, it will be returned.
|
|
133
|
+
*
|
|
134
|
+
* Otherwise, if settings exist for a metric with this name, either provided
|
|
135
|
+
* by the platform or by configuration, a metric will be created.
|
|
136
|
+
*
|
|
137
|
+
* Otherwise, returns undefined.
|
|
138
|
+
*
|
|
139
|
+
* Subsequent calls to this method with the same name return the same metric.
|
|
140
|
+
*
|
|
141
|
+
* @param name the name of the metric, e.g. platform_startup
|
|
142
|
+
*/
|
|
143
|
+
get(name: string): Metric | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* Creates or retrieves a metric based on the provided settings.
|
|
146
|
+
*
|
|
147
|
+
* If a metric is already created with this name, it will be returned.
|
|
148
|
+
*
|
|
149
|
+
* Otherwise, if settings exist for a metric with this name, either provided
|
|
150
|
+
* by the platform or by configuration, they will be merged with the
|
|
151
|
+
* settings provided to this method before creating it.
|
|
152
|
+
*
|
|
153
|
+
* Otherwise, the settings provided will be used as is.
|
|
154
|
+
*
|
|
155
|
+
* Subsequent calls to this method with the same name return the same metric.
|
|
156
|
+
*
|
|
157
|
+
* @param settings settings to use when creating the metric
|
|
158
|
+
*/
|
|
129
159
|
getFromSettings(settings: MetricSettings): Metric | undefined;
|
|
130
160
|
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Builder class used to set up Metrics module.
|
|
164
|
+
*/
|
|
131
165
|
export interface MetricsManagerBuilder {
|
|
132
166
|
build(): MetricsManager;
|
|
133
167
|
withLogger(logger: Logger): this;
|
|
@@ -136,11 +170,18 @@ export namespace IOInsights {
|
|
|
136
170
|
withDependencyContainer(container: MetricsDependencyContainer): this;
|
|
137
171
|
}
|
|
138
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Advanced usage. Allows overriding meterProvider and metricReaders instantiation
|
|
175
|
+
* logic.
|
|
176
|
+
*/
|
|
139
177
|
export type MetricsMeterProviderCreateFunc = () => {
|
|
140
178
|
meterProvider: MetricsMeterProvider;
|
|
141
179
|
metricReaders: MetricReader[];
|
|
142
180
|
};
|
|
143
181
|
|
|
182
|
+
/**
|
|
183
|
+
* @ignore
|
|
184
|
+
*/
|
|
144
185
|
export interface MetricsMeterProvider extends MeterProvider {
|
|
145
186
|
forceFlush(): Promise<void>;
|
|
146
187
|
}
|
|
@@ -157,6 +198,7 @@ export namespace IOInsights {
|
|
|
157
198
|
unsubscribeCallback?: () => Promise<void>
|
|
158
199
|
): Metric;
|
|
159
200
|
}
|
|
201
|
+
|
|
160
202
|
/**
|
|
161
203
|
* @ignore
|
|
162
204
|
*/
|
|
@@ -325,7 +367,7 @@ export namespace IOInsights {
|
|
|
325
367
|
user?: string;
|
|
326
368
|
unit?: string;
|
|
327
369
|
buckets?: number[];
|
|
328
|
-
baseMetricType?: "histogram" | "gauge";
|
|
370
|
+
baseMetricType?: "histogram" | "gauge";
|
|
329
371
|
additionalAttributes?: { [key: string]: unknown } | (() => { [key: string]: unknown });
|
|
330
372
|
publishingSettings?: MetricPublishingSettings;
|
|
331
373
|
}
|
|
@@ -334,6 +376,11 @@ export namespace IOInsights {
|
|
|
334
376
|
* Controls the publishing of the metric.
|
|
335
377
|
*/
|
|
336
378
|
export interface MetricPublishingSettings {
|
|
379
|
+
/**
|
|
380
|
+
* Defines sampling probability for the metric.
|
|
381
|
+
*
|
|
382
|
+
* @default true
|
|
383
|
+
*/
|
|
337
384
|
sample?: number | boolean;
|
|
338
385
|
/**
|
|
339
386
|
* Controls the publishing of specific attributes.
|
|
@@ -355,14 +402,43 @@ export namespace IOInsights {
|
|
|
355
402
|
reduceModality?: number;
|
|
356
403
|
}
|
|
357
404
|
|
|
405
|
+
/**
|
|
406
|
+
* Base interface for all metrics.
|
|
407
|
+
*/
|
|
358
408
|
export interface Metric {
|
|
409
|
+
/**
|
|
410
|
+
* Settings used to create the metric.
|
|
411
|
+
*/
|
|
359
412
|
settings: MetricSettings;
|
|
413
|
+
/**
|
|
414
|
+
* Whether the metric is started.
|
|
415
|
+
*/
|
|
360
416
|
started: boolean;
|
|
361
417
|
|
|
418
|
+
/**
|
|
419
|
+
* Starts the metric, allowing it to publish values.
|
|
420
|
+
*/
|
|
362
421
|
start(): Promise<void>;
|
|
422
|
+
/**
|
|
423
|
+
* Stops the metric, meaning it can no long publish values.
|
|
424
|
+
*/
|
|
363
425
|
stop(): Promise<void>;
|
|
364
426
|
}
|
|
365
427
|
|
|
428
|
+
/**
|
|
429
|
+
* Base interface for non-observable metrics with independent values, such as Gauge and Histogram.
|
|
430
|
+
*/
|
|
431
|
+
export interface RecordingMetric<TData extends IOInsights.MetricData> extends Metric {
|
|
432
|
+
record(value: number, data?: TData): void;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Base interface for non-observable metrics with incremental values, such as Counter and UpDownCounter.
|
|
437
|
+
*/
|
|
438
|
+
export interface IncrementalMetric<TData extends IOInsights.MetricData> extends Metric {
|
|
439
|
+
add(count: number, data?: TData): void;
|
|
440
|
+
}
|
|
441
|
+
|
|
366
442
|
/**
|
|
367
443
|
* @ignore
|
|
368
444
|
*/
|
|
@@ -429,11 +505,21 @@ export namespace IOInsights {
|
|
|
429
505
|
/*rest: */
|
|
430
506
|
| "null";
|
|
431
507
|
|
|
508
|
+
/**
|
|
509
|
+
* Metric filters that can be specified as default.
|
|
510
|
+
*
|
|
511
|
+
* Metric filters allow controlling specific metric data points, e.g.
|
|
512
|
+
* whether a particular value of a specific metric will be published.
|
|
513
|
+
*/
|
|
432
514
|
export interface MetricDefaultFilter {
|
|
515
|
+
/**
|
|
516
|
+
* Matches the type of the metric.
|
|
517
|
+
*/
|
|
433
518
|
type?: MetricType;
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
519
|
+
/**
|
|
520
|
+
* Matches the attributes attached to a metric value. Not all metrics
|
|
521
|
+
* have all attribute values.
|
|
522
|
+
*/
|
|
437
523
|
attributes?: {
|
|
438
524
|
/**
|
|
439
525
|
* Indicates whether the workspace loading involved a complex operation where existing apps are added to a new workspace.
|
|
@@ -445,11 +531,42 @@ export namespace IOInsights {
|
|
|
445
531
|
*/
|
|
446
532
|
includesFrameCreation?: boolean;
|
|
447
533
|
};
|
|
534
|
+
/**
|
|
535
|
+
* Whether or not the value for the matching metric will be published.
|
|
536
|
+
*/
|
|
537
|
+
enabled: boolean;
|
|
538
|
+
/**
|
|
539
|
+
* Sampling probability.
|
|
540
|
+
*/
|
|
541
|
+
sample?: number | boolean;
|
|
542
|
+
/**
|
|
543
|
+
* If `true`, this filter rule will be matched before any default filters provided
|
|
544
|
+
* by io.Connect. The default filters are usually meant filter out non-representative
|
|
545
|
+
* operations (e.g. partial workspace loads), but you can use this property to
|
|
546
|
+
* force them to be measured.
|
|
547
|
+
* If `false`, default filters will be matched before this filtering rule.
|
|
548
|
+
*
|
|
549
|
+
* @default false
|
|
550
|
+
*/
|
|
551
|
+
overrideDefaultFilters?: boolean;
|
|
448
552
|
}
|
|
553
|
+
/**
|
|
554
|
+
* Metric filters that can be specified as part of a specific metric.
|
|
555
|
+
*/
|
|
449
556
|
export interface MetricFilter extends MetricDefaultFilter {
|
|
557
|
+
/**
|
|
558
|
+
* The name of the matched metric.
|
|
559
|
+
*/
|
|
450
560
|
name: string;
|
|
561
|
+
/**
|
|
562
|
+
* The type of the matched metric.
|
|
563
|
+
*/
|
|
451
564
|
type: MetricType;
|
|
452
565
|
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* @ignore
|
|
569
|
+
*/
|
|
453
570
|
export interface MetricsDependencyContainer {
|
|
454
571
|
performanceProvider: PerformanceProvider;
|
|
455
572
|
instanceStartedHandler: InstanceActionHandler;
|
|
@@ -477,12 +594,19 @@ export namespace IOInsights {
|
|
|
477
594
|
platformStartedHandler: PlatformStartedHandler;
|
|
478
595
|
platformErrorHandler: PlatformErrorHandler;
|
|
479
596
|
}
|
|
597
|
+
/**
|
|
598
|
+
* @ignore
|
|
599
|
+
*/
|
|
480
600
|
export type Unsubscribe = () => void;
|
|
481
|
-
|
|
601
|
+
/**
|
|
602
|
+
* @ignore
|
|
603
|
+
*/
|
|
482
604
|
export interface InstanceActionHandlerArgs {
|
|
483
605
|
application: string;
|
|
484
606
|
}
|
|
485
|
-
|
|
607
|
+
/**
|
|
608
|
+
* @ignore
|
|
609
|
+
*/
|
|
486
610
|
export type InstanceActionHandler = (
|
|
487
611
|
callback: (args: InstanceActionHandlerArgs) => void
|
|
488
612
|
) => Unsubscribe;
|
|
@@ -490,49 +614,71 @@ export namespace IOInsights {
|
|
|
490
614
|
export interface InstanceErrorHandlerArgs {
|
|
491
615
|
application: string;
|
|
492
616
|
}
|
|
493
|
-
|
|
617
|
+
/**
|
|
618
|
+
* @ignore
|
|
619
|
+
*/
|
|
494
620
|
export type InstanceErrorHandler = (
|
|
495
621
|
callback: (args: InstanceErrorHandlerArgs) => void
|
|
496
622
|
) => Unsubscribe;
|
|
497
|
-
|
|
623
|
+
/**
|
|
624
|
+
* @ignore
|
|
625
|
+
*/
|
|
498
626
|
export interface PlatformErrorHandlerArgs {}
|
|
499
|
-
|
|
627
|
+
/**
|
|
628
|
+
* @ignore
|
|
629
|
+
*/
|
|
500
630
|
export type PlatformErrorHandler = (
|
|
501
631
|
callback: (args: PlatformErrorHandlerArgs) => void
|
|
502
632
|
) => Unsubscribe;
|
|
503
|
-
|
|
633
|
+
/**
|
|
634
|
+
* @ignore
|
|
635
|
+
*/
|
|
504
636
|
export interface InstanceCrashHandlerArgs {
|
|
505
637
|
application: string;
|
|
506
638
|
reason: string;
|
|
507
639
|
}
|
|
508
|
-
|
|
640
|
+
/**
|
|
641
|
+
* @ignore
|
|
642
|
+
*/
|
|
509
643
|
export type InstanceCrashHandler = (
|
|
510
644
|
callback: (args: InstanceCrashHandlerArgs) => void
|
|
511
645
|
) => Unsubscribe;
|
|
512
|
-
|
|
646
|
+
/**
|
|
647
|
+
* @ignore
|
|
648
|
+
*/
|
|
513
649
|
export interface InstanceFocusedHandlerArgs {
|
|
514
650
|
application: string;
|
|
515
651
|
focused: boolean;
|
|
516
652
|
}
|
|
517
|
-
|
|
653
|
+
/**
|
|
654
|
+
* @ignore
|
|
655
|
+
*/
|
|
518
656
|
export type InstanceFocusedHandler = (
|
|
519
657
|
callback: (args: InstanceFocusedHandlerArgs) => void
|
|
520
658
|
) => Unsubscribe;
|
|
521
|
-
|
|
659
|
+
/**
|
|
660
|
+
* @ignore
|
|
661
|
+
*/
|
|
522
662
|
export interface LayoutRestoredHandlerArgs {
|
|
523
663
|
layout: string;
|
|
524
664
|
startTime: Date;
|
|
525
665
|
endTime: Date;
|
|
526
666
|
}
|
|
527
|
-
|
|
667
|
+
/**
|
|
668
|
+
* @ignore
|
|
669
|
+
*/
|
|
528
670
|
export type LayoutRestoredHandler = (
|
|
529
671
|
callback: (args: LayoutRestoredHandlerArgs) => void
|
|
530
672
|
) => Unsubscribe;
|
|
531
|
-
|
|
673
|
+
/**
|
|
674
|
+
* @ignore
|
|
675
|
+
*/
|
|
532
676
|
export interface WorkspaceActionHandlerArgs {
|
|
533
677
|
layout: string;
|
|
534
678
|
}
|
|
535
|
-
|
|
679
|
+
/**
|
|
680
|
+
* @ignore
|
|
681
|
+
*/
|
|
536
682
|
export interface WorkspaceTimedActionHandlerArgs extends WorkspaceActionHandlerArgs {
|
|
537
683
|
startTime: Date;
|
|
538
684
|
endTime: Date;
|
|
@@ -547,7 +693,9 @@ export namespace IOInsights {
|
|
|
547
693
|
includesFrameCreation: boolean;
|
|
548
694
|
[x: string]: any;
|
|
549
695
|
}
|
|
550
|
-
|
|
696
|
+
/**
|
|
697
|
+
* @ignore
|
|
698
|
+
*/
|
|
551
699
|
export interface WorkspaceRestoredHandlerArgs extends WorkspaceActionHandlerArgs {
|
|
552
700
|
startTime: Date;
|
|
553
701
|
endTime: Date;
|
|
@@ -562,7 +710,9 @@ export namespace IOInsights {
|
|
|
562
710
|
includesFrameCreation?: boolean;
|
|
563
711
|
[x: string]: any;
|
|
564
712
|
}
|
|
565
|
-
|
|
713
|
+
/**
|
|
714
|
+
* @ignore
|
|
715
|
+
*/
|
|
566
716
|
export interface WorkspaceAppsStartedHandlerArgs extends WorkspaceTimedActionHandlerArgs {
|
|
567
717
|
/**
|
|
568
718
|
* Indicates whether the workspace loading involved a complex operation where existing apps are added to a new workspace.
|
|
@@ -570,56 +720,86 @@ export namespace IOInsights {
|
|
|
570
720
|
*/
|
|
571
721
|
complexLoad: boolean;
|
|
572
722
|
}
|
|
573
|
-
|
|
723
|
+
/**
|
|
724
|
+
* @ignore
|
|
725
|
+
*/
|
|
574
726
|
export interface WorkspaceStartupHandlerArgs extends WorkspaceAppsStartedHandlerArgs {
|
|
575
727
|
/**
|
|
576
728
|
* Indicates whether the metric includes the time to create and load the Workspace Frame App when the workspace is opened in a new frame.
|
|
577
729
|
*/
|
|
578
730
|
includesFrameCreation: boolean;
|
|
579
731
|
}
|
|
580
|
-
|
|
732
|
+
/**
|
|
733
|
+
* @ignore
|
|
734
|
+
*/
|
|
581
735
|
export interface WorkspaceSavedHandlerArgs extends WorkspaceActionHandlerArgs {
|
|
582
736
|
oldLayout: string;
|
|
583
737
|
}
|
|
738
|
+
/**
|
|
739
|
+
* @ignore
|
|
740
|
+
*/
|
|
584
741
|
export interface WorkspaceLoadedHandlerArgs extends WorkspaceActionHandlerArgs {
|
|
585
742
|
startTime: Date;
|
|
586
743
|
endTime: Date;
|
|
587
744
|
complexLoad?: boolean;
|
|
588
745
|
includesFrameCreation?: boolean;
|
|
589
746
|
}
|
|
590
|
-
|
|
747
|
+
/**
|
|
748
|
+
* @ignore
|
|
749
|
+
*/
|
|
591
750
|
export type WorkspaceGenericActionHandler<T extends WorkspaceActionHandlerArgs> = (
|
|
592
751
|
callback: (args: T) => void
|
|
593
752
|
) => Unsubscribe;
|
|
594
|
-
|
|
753
|
+
/**
|
|
754
|
+
* @ignore
|
|
755
|
+
*/
|
|
595
756
|
export type WorkspaceActionHandler = WorkspaceGenericActionHandler<WorkspaceActionHandlerArgs>;
|
|
757
|
+
/**
|
|
758
|
+
* @ignore
|
|
759
|
+
*/
|
|
596
760
|
export type WorkspaceLoadedHandler = WorkspaceGenericActionHandler<WorkspaceLoadedHandlerArgs>;
|
|
761
|
+
/**
|
|
762
|
+
* @ignore
|
|
763
|
+
*/
|
|
597
764
|
export type WorkspaceRestoredHandler =
|
|
598
765
|
WorkspaceGenericActionHandler<WorkspaceRestoredHandlerArgs>;
|
|
766
|
+
/**
|
|
767
|
+
* @ignore
|
|
768
|
+
*/
|
|
599
769
|
export type WorkspaceSavedHandler = WorkspaceGenericActionHandler<WorkspaceSavedHandlerArgs>;
|
|
600
|
-
|
|
770
|
+
/**
|
|
771
|
+
* @ignore
|
|
772
|
+
*/
|
|
601
773
|
export interface InstanceReadyHandlerArgs {
|
|
602
774
|
application: string;
|
|
603
775
|
startTime: Date;
|
|
604
776
|
endTime: Date;
|
|
605
777
|
api: string;
|
|
606
778
|
}
|
|
607
|
-
|
|
779
|
+
/**
|
|
780
|
+
* @ignore
|
|
781
|
+
*/
|
|
608
782
|
export type InstanceReadyHandler = (
|
|
609
783
|
callback: (args: InstanceReadyHandlerArgs) => void
|
|
610
784
|
) => Unsubscribe;
|
|
611
|
-
|
|
785
|
+
/**
|
|
786
|
+
* @ignore
|
|
787
|
+
*/
|
|
612
788
|
export interface PlatformStartedHandlerArgs {
|
|
613
789
|
startTime: Date;
|
|
614
790
|
endTime: Date;
|
|
615
791
|
idleTimeMs?: number;
|
|
616
792
|
api: string;
|
|
617
793
|
}
|
|
618
|
-
|
|
794
|
+
/**
|
|
795
|
+
* @ignore
|
|
796
|
+
*/
|
|
619
797
|
export type PlatformStartedHandler = (
|
|
620
798
|
callback: (args: PlatformStartedHandlerArgs) => void
|
|
621
799
|
) => Unsubscribe;
|
|
622
|
-
|
|
800
|
+
/**
|
|
801
|
+
* @ignore
|
|
802
|
+
*/
|
|
623
803
|
export interface PerformanceProvider {
|
|
624
804
|
getAppsCPU(): Promise<AppCPU[] | undefined>;
|
|
625
805
|
getAppsMemory(): Promise<AppMemory[] | undefined>;
|
|
@@ -627,25 +807,33 @@ export namespace IOInsights {
|
|
|
627
807
|
getSystemCPU(): Promise<SystemCPU | undefined>;
|
|
628
808
|
getSystemMemory(): Promise<SystemMemory | undefined>;
|
|
629
809
|
}
|
|
630
|
-
|
|
810
|
+
/**
|
|
811
|
+
* @ignore
|
|
812
|
+
*/
|
|
631
813
|
export interface AppCPU {
|
|
632
814
|
app: string;
|
|
633
815
|
instance: string;
|
|
634
816
|
cpu: number;
|
|
635
817
|
}
|
|
636
|
-
|
|
818
|
+
/**
|
|
819
|
+
* @ignore
|
|
820
|
+
*/
|
|
637
821
|
export interface AppMemory {
|
|
638
822
|
app: string;
|
|
639
823
|
instance: string;
|
|
640
824
|
memory: number;
|
|
641
825
|
}
|
|
642
|
-
|
|
826
|
+
/**
|
|
827
|
+
* @ignore
|
|
828
|
+
*/
|
|
643
829
|
export interface SystemCPU {
|
|
644
830
|
current: number;
|
|
645
831
|
average: number;
|
|
646
832
|
platform: number;
|
|
647
833
|
}
|
|
648
|
-
|
|
834
|
+
/**
|
|
835
|
+
* @ignore
|
|
836
|
+
*/
|
|
649
837
|
export interface SystemMemory {
|
|
650
838
|
platformTotal: number;
|
|
651
839
|
systemTotal: number;
|
|
@@ -656,6 +844,9 @@ export namespace IOInsights {
|
|
|
656
844
|
* Traces API.
|
|
657
845
|
*/
|
|
658
846
|
export interface TracesManager extends Manager<TracesSettings> {
|
|
847
|
+
/**
|
|
848
|
+
* The tracing state representing the currently active trace and span, if any.
|
|
849
|
+
*/
|
|
659
850
|
currentTracingState: TracingState | null;
|
|
660
851
|
|
|
661
852
|
/**
|
|
@@ -678,6 +869,7 @@ export namespace IOInsights {
|
|
|
678
869
|
* Works in conjunction with the userJourney setting to track the user's entire session flow.
|
|
679
870
|
*/
|
|
680
871
|
userJourneyMarker?: MarkerSpanCallback;
|
|
872
|
+
/** @ignore */
|
|
681
873
|
setUserJourneyMarker(userJourneyMarker: MarkerSpanCallback): void;
|
|
682
874
|
|
|
683
875
|
/**
|
|
@@ -695,8 +887,18 @@ export namespace IOInsights {
|
|
|
695
887
|
*/
|
|
696
888
|
clickstreamMarker?: MarkerSpanCallback;
|
|
697
889
|
|
|
890
|
+
/**
|
|
891
|
+
* Allows updating the configured filters.
|
|
892
|
+
*/
|
|
698
893
|
setFilterConfig(filters: SpanFilter[]): void;
|
|
699
894
|
|
|
895
|
+
/**
|
|
896
|
+
* Allows creating a span for a named trace.
|
|
897
|
+
*
|
|
898
|
+
* @param source The name of the span to create.
|
|
899
|
+
* @param traceName The name of the trace to nest the span in. If one doesn't exist, it will be created.
|
|
900
|
+
* @param callback Logic to execute in the span.
|
|
901
|
+
*/
|
|
700
902
|
withSequenceSpanEx<T>(
|
|
701
903
|
source: string,
|
|
702
904
|
traceName:
|
|
@@ -705,6 +907,14 @@ export namespace IOInsights {
|
|
|
705
907
|
callback:
|
|
706
908
|
| IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
707
909
|
|
|
910
|
+
/**
|
|
911
|
+
* Allows creating a span for a named trace.
|
|
912
|
+
*
|
|
913
|
+
* @param source The name of the span to create.
|
|
914
|
+
* @param traceName The name of the trace to nest the span in. If one doesn't exist, it will be created.
|
|
915
|
+
* @param filteringContext Filtering context used to match against the tracing filtering configuration.
|
|
916
|
+
* @param callback Logic to execute in the span.
|
|
917
|
+
*/
|
|
708
918
|
withSequenceSpanEx<T>(
|
|
709
919
|
source: string,
|
|
710
920
|
traceName:
|
|
@@ -716,6 +926,15 @@ export namespace IOInsights {
|
|
|
716
926
|
callback:
|
|
717
927
|
| IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
718
928
|
|
|
929
|
+
/**
|
|
930
|
+
* Allows creating a span for a named trace.
|
|
931
|
+
*
|
|
932
|
+
* @param source The name of the span to create.
|
|
933
|
+
* @param traceName The name of the trace to nest the span in. If one doesn't exist, it will be created.
|
|
934
|
+
* @param filteringContext Filtering context used to match against the tracing filtering configuration.
|
|
935
|
+
* @param options Options to use when creating the span.
|
|
936
|
+
* @param callback Logic to execute in the span.
|
|
937
|
+
*/
|
|
719
938
|
withSequenceSpanEx<T>(
|
|
720
939
|
source: string,
|
|
721
940
|
traceName:
|
|
@@ -730,6 +949,9 @@ export namespace IOInsights {
|
|
|
730
949
|
callback:
|
|
731
950
|
| IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
732
951
|
|
|
952
|
+
/**
|
|
953
|
+
* @ignore
|
|
954
|
+
*/
|
|
733
955
|
withSequenceSpanEx<T>(
|
|
734
956
|
source: string,
|
|
735
957
|
traceName:
|
|
@@ -746,11 +968,24 @@ export namespace IOInsights {
|
|
|
746
968
|
callback?:
|
|
747
969
|
| IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
748
970
|
|
|
971
|
+
/**
|
|
972
|
+
* Allows creating a span for a named trace.
|
|
973
|
+
*
|
|
974
|
+
* @param source The name of the span to create. The name of the trace will be <source>.start, and if one doesn't exist, it will be created.
|
|
975
|
+
* @param callback Logic to execute in the span.
|
|
976
|
+
*/
|
|
749
977
|
withSequenceSpan<T>(
|
|
750
978
|
source: string,
|
|
751
979
|
callback:
|
|
752
980
|
| IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
753
981
|
|
|
982
|
+
/**
|
|
983
|
+
* Allows creating a span for a named trace.
|
|
984
|
+
*
|
|
985
|
+
* @param source The name of the span to create. The name of the trace will be <source>.start, and if one doesn't exist, it will be created.
|
|
986
|
+
* @param filteringContext Filtering context used to match against the tracing filtering configuration.
|
|
987
|
+
* @param callback Logic to execute in the span.
|
|
988
|
+
*/
|
|
754
989
|
withSequenceSpan<T>(
|
|
755
990
|
source: string,
|
|
756
991
|
filteringContext:
|
|
@@ -759,6 +994,14 @@ export namespace IOInsights {
|
|
|
759
994
|
callback:
|
|
760
995
|
| IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
761
996
|
|
|
997
|
+
/**
|
|
998
|
+
* Allows creating a span for a named trace.
|
|
999
|
+
*
|
|
1000
|
+
* @param source The name of the span to create. The name of the trace will be <source>.start, and if one doesn't exist, it will be created.
|
|
1001
|
+
* @param filteringContext Filtering context used to match against the tracing filtering configuration.
|
|
1002
|
+
* @param options Options to use when creating the span.
|
|
1003
|
+
* @param callback Logic to execute in the span.
|
|
1004
|
+
*/
|
|
762
1005
|
withSequenceSpan<T>(
|
|
763
1006
|
source: string,
|
|
764
1007
|
filteringContext:
|
|
@@ -770,6 +1013,9 @@ export namespace IOInsights {
|
|
|
770
1013
|
callback:
|
|
771
1014
|
| IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
772
1015
|
|
|
1016
|
+
/**
|
|
1017
|
+
* @ignore
|
|
1018
|
+
*/
|
|
773
1019
|
withSequenceSpan<T>(
|
|
774
1020
|
source: string,
|
|
775
1021
|
filteringContextOrCallback:
|
|
@@ -783,14 +1029,36 @@ export namespace IOInsights {
|
|
|
783
1029
|
callback?:
|
|
784
1030
|
| IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
785
1031
|
|
|
786
|
-
|
|
787
|
-
|
|
1032
|
+
/**
|
|
1033
|
+
* Allows creating a span for the currently active trace. If one doesn't exist, it will be created.
|
|
1034
|
+
*
|
|
1035
|
+
* @param source The name of the span to create.
|
|
1036
|
+
* @param callback Logic to execute in the span.
|
|
1037
|
+
*/
|
|
1038
|
+
withSpan<T>(
|
|
1039
|
+
source: string,
|
|
1040
|
+
callback: WithSpanCallback<T>): T;
|
|
1041
|
+
/**
|
|
1042
|
+
* Allows creating a span for the currently active trace. If one doesn't exist, it will be created.
|
|
1043
|
+
*
|
|
1044
|
+
* @param source The name of the span to create.
|
|
1045
|
+
* @param filteringContext Filtering context used to match against the tracing filtering configuration.
|
|
1046
|
+
* @param callback Logic to execute in the span.
|
|
1047
|
+
*/
|
|
788
1048
|
withSpan<T>(
|
|
789
1049
|
source: string,
|
|
790
1050
|
filteringContext: FilteringContext,
|
|
791
1051
|
callback: WithSpanCallback<T>
|
|
792
1052
|
): T;
|
|
793
1053
|
|
|
1054
|
+
/**
|
|
1055
|
+
* Allows creating a span for the currently active trace or a specified trace. If one doesn't exist, it will be created.
|
|
1056
|
+
*
|
|
1057
|
+
* @param source The name of the span to create.
|
|
1058
|
+
* @param filteringContext Filtering context used to match against the tracing filtering configuration.
|
|
1059
|
+
* @param propagationInfo Span and trace id to use for manually nesting the new trace.
|
|
1060
|
+
* @param callback Logic to execute in the span.
|
|
1061
|
+
*/
|
|
794
1062
|
withSpan<T>(
|
|
795
1063
|
source: string,
|
|
796
1064
|
filteringContext: FilteringContext,
|
|
@@ -798,6 +1066,15 @@ export namespace IOInsights {
|
|
|
798
1066
|
callback: WithSpanCallback<T>
|
|
799
1067
|
): T;
|
|
800
1068
|
|
|
1069
|
+
/**
|
|
1070
|
+
* Allows creating a span for the currently active trace or a specified trace. If one doesn't exist, it will be created.
|
|
1071
|
+
*
|
|
1072
|
+
* @param source The name of the span to create.
|
|
1073
|
+
* @param filteringContext Filtering context used to match against the tracing filtering configuration.
|
|
1074
|
+
* @param propagationInfo Span and trace id to use for manually nesting the new trace.
|
|
1075
|
+
* @param options Options to use when creating the span.
|
|
1076
|
+
* @param callback Logic to execute in the span.
|
|
1077
|
+
*/
|
|
801
1078
|
withSpan<T>(
|
|
802
1079
|
source: string,
|
|
803
1080
|
filteringContext: FilteringContext,
|
|
@@ -808,6 +1085,9 @@ export namespace IOInsights {
|
|
|
808
1085
|
}
|
|
809
1086
|
|
|
810
1087
|
interface TracingState {
|
|
1088
|
+
/**
|
|
1089
|
+
* Ends the current span. Same as endSpan().
|
|
1090
|
+
*/
|
|
811
1091
|
end(): void;
|
|
812
1092
|
/**
|
|
813
1093
|
* If false, this is a placeholder object, and all its methods
|
|
@@ -858,6 +1138,9 @@ export namespace IOInsights {
|
|
|
858
1138
|
*/
|
|
859
1139
|
enabled: boolean;
|
|
860
1140
|
|
|
1141
|
+
/**
|
|
1142
|
+
* Property for internal use.
|
|
1143
|
+
*/
|
|
861
1144
|
rootPropagationInfo?: PropagationInfo;
|
|
862
1145
|
|
|
863
1146
|
/**
|
|
@@ -1051,10 +1334,16 @@ export namespace IOInsights {
|
|
|
1051
1334
|
*
|
|
1052
1335
|
* If 'url' is specified, TracerProvider will
|
|
1053
1336
|
* have an OTLPTraceExporter with 'url' as detination URL and
|
|
1054
|
-
* '
|
|
1337
|
+
* 'exporterSettings' as additional config.
|
|
1055
1338
|
*/
|
|
1056
1339
|
exporterSettings?: OTLPExporterNodeConfigBase;
|
|
1057
1340
|
|
|
1341
|
+
/**
|
|
1342
|
+
* @deprecated Use exporterSettings
|
|
1343
|
+
*/
|
|
1344
|
+
otlpExporterConfig?: OTLPExporterNodeConfigBase;
|
|
1345
|
+
|
|
1346
|
+
|
|
1058
1347
|
/**
|
|
1059
1348
|
* OTEL TracerConfig - provides an interface for configuring a Basic Tracer.
|
|
1060
1349
|
*/
|
|
@@ -1103,31 +1392,55 @@ export namespace IOInsights {
|
|
|
1103
1392
|
*/
|
|
1104
1393
|
additionalResourceAttributes?: { [x: string]: unknown } | (() => { [x: string]: unknown });
|
|
1105
1394
|
|
|
1395
|
+
/**
|
|
1396
|
+
* Allows specifying a constructor callback for creating the tracerProvider instance.
|
|
1397
|
+
*/
|
|
1106
1398
|
tracerProvider?: (tracerProviderSettings: TracerConfig, tracesSettings: IOInsights.TracesSettings, settings: IOInsights.Settings) => TracerProvider;
|
|
1399
|
+
/**
|
|
1400
|
+
* Allows specifying a constructor callback for creating the Sampler instance.
|
|
1401
|
+
*/
|
|
1107
1402
|
sampler?: (defaultSampler: Sampler, tracesSettings: IOInsights.TracesSettings, settings: IOInsights.Settings) => Sampler;
|
|
1403
|
+
/**
|
|
1404
|
+
* Allows specifying a constructor callback for creating the SpanProcessor instances.
|
|
1405
|
+
*/
|
|
1108
1406
|
spanProcessors?: (processorSettings: BatchSpanProcessorBrowserConfig | undefined, exporterSettings: OTLPExporterNodeConfigBase, tracesSettings: IOInsights.TracesSettings, settings: IOInsights.Settings) => SpanProcessor[];
|
|
1407
|
+
/**
|
|
1408
|
+
* Allows specifying a constructor callback for creating the SpanExporter instances.
|
|
1409
|
+
*/
|
|
1109
1410
|
spanExporters?: (exporterSettings: OTLPExporterNodeConfigBase, tracesSettings: IOInsights.TracesSettings, settings: IOInsights.Settings) => SpanExporter[];
|
|
1411
|
+
/**
|
|
1412
|
+
* Allows specifying a constructor callback for creating the TextMapPropagator instance.
|
|
1413
|
+
*/
|
|
1110
1414
|
propagator?: (tracesSettings: IOInsights.TracesSettings, settings: IOInsights.Settings) => TextMapPropagator;
|
|
1415
|
+
/**
|
|
1416
|
+
* Allows specifying a constructor callback for creating the ContextManager instance.
|
|
1417
|
+
*/
|
|
1111
1418
|
contextManager?: (tracesSettings: IOInsights.TracesSettings, settings: IOInsights.Settings) => ContextManager;
|
|
1112
|
-
providerRegistrationSettings?: (tracesSettings: IOInsights.TracesSettings, settings: IOInsights.Settings) => {
|
|
1113
|
-
propagator?: TextMapPropagator;
|
|
1114
|
-
contextManager?: ContextManager;
|
|
1115
|
-
};
|
|
1116
1419
|
}
|
|
1117
1420
|
|
|
1421
|
+
/**
|
|
1422
|
+
* Builder class used to set up Traces module.
|
|
1423
|
+
*/
|
|
1118
1424
|
export interface TracesManagerBuilder {
|
|
1119
1425
|
build(): TracesManager;
|
|
1120
1426
|
withLogger(logger: Logger): this;
|
|
1121
1427
|
withSettings(settings: TracesSettings): this;
|
|
1122
1428
|
withMetrics(metrics: IOInsights.MetricsManager): this;
|
|
1123
1429
|
withTraceLogger(traceLogger: IOInsights.Logger): this;
|
|
1430
|
+
withContextManager(contextManager: ContextManager): this;
|
|
1124
1431
|
withPropagationInfoStorage(
|
|
1125
1432
|
store: (source: string, pi: PropagationInfo) => Promise<void>,
|
|
1126
1433
|
read: (source: string) => Promise<PropagationInfo | null>): this;
|
|
1127
1434
|
}
|
|
1128
1435
|
|
|
1436
|
+
/**
|
|
1437
|
+
* Callback executed during a span. See `withSpan`
|
|
1438
|
+
*/
|
|
1129
1439
|
export type WithSpanCallback<T> = (tracingState: TracingState) => T;
|
|
1130
1440
|
|
|
1441
|
+
/**
|
|
1442
|
+
* Options that can be provided when using `withSpan` as a decorator
|
|
1443
|
+
*/
|
|
1131
1444
|
export interface WithSpanDecoratorOptions extends WithSpanOptions {
|
|
1132
1445
|
argMapping?:
|
|
1133
1446
|
| { [x: string]: string }
|
|
@@ -1136,11 +1449,17 @@ export namespace IOInsights {
|
|
|
1136
1449
|
thisMapping?: { [x: string]: string } | ((that: any) => any);
|
|
1137
1450
|
}
|
|
1138
1451
|
|
|
1452
|
+
/**
|
|
1453
|
+
* Span and trace information that can be used to manually control the
|
|
1454
|
+
* nesting of a newly created span.
|
|
1455
|
+
*/
|
|
1139
1456
|
export interface PropagationInfo {
|
|
1140
1457
|
traceparent?: string;
|
|
1141
1458
|
tracestate?: string;
|
|
1142
1459
|
forceTracing?: boolean;
|
|
1143
1460
|
}
|
|
1461
|
+
|
|
1462
|
+
/** @ignore */
|
|
1144
1463
|
export interface PropagationInfoCarrier {
|
|
1145
1464
|
__interopIOTracePropagationInfo?: PropagationInfo;
|
|
1146
1465
|
}
|
|
@@ -1150,6 +1469,9 @@ export namespace IOInsights {
|
|
|
1150
1469
|
fullFilteringContext: FilteringContext
|
|
1151
1470
|
) => PropagationInfo | null;
|
|
1152
1471
|
|
|
1472
|
+
/**
|
|
1473
|
+
* Key-value pair that can be used to match a span against a filter in the tracing filtering config.
|
|
1474
|
+
*/
|
|
1153
1475
|
export type FilteringContext = {
|
|
1154
1476
|
app?: string;
|
|
1155
1477
|
user?: string;
|
|
@@ -1161,6 +1483,9 @@ export namespace IOInsights {
|
|
|
1161
1483
|
userId?: string;
|
|
1162
1484
|
} & Record<string, any>;
|
|
1163
1485
|
|
|
1486
|
+
/**
|
|
1487
|
+
* Verbosity level of a span. Controls how much information is added using `.addData()`.
|
|
1488
|
+
*/
|
|
1164
1489
|
export enum SpanVerbosity {
|
|
1165
1490
|
OFF,
|
|
1166
1491
|
LOWEST,
|
|
@@ -1170,6 +1495,10 @@ export namespace IOInsights {
|
|
|
1170
1495
|
WARN,
|
|
1171
1496
|
HIGHEST,
|
|
1172
1497
|
}
|
|
1498
|
+
|
|
1499
|
+
/**
|
|
1500
|
+
* Options that can be used when creating a span.
|
|
1501
|
+
*/
|
|
1173
1502
|
export interface WithSpanOptions extends Omit<SpanCreationOptions, "sample"> {
|
|
1174
1503
|
defaultFilters?: SpanFilter[];
|
|
1175
1504
|
structure?: "sibling" | "nested";
|
|
@@ -1294,6 +1623,7 @@ export namespace IOInsights {
|
|
|
1294
1623
|
*/
|
|
1295
1624
|
minDurationMs?: number;
|
|
1296
1625
|
|
|
1626
|
+
/** @ignore */
|
|
1297
1627
|
getPropagationInfo?: PropagationInfoCallback;
|
|
1298
1628
|
|
|
1299
1629
|
/**
|
|
@@ -1313,6 +1643,9 @@ export namespace IOInsights {
|
|
|
1313
1643
|
overrideDefaultFilters?: boolean;
|
|
1314
1644
|
}
|
|
1315
1645
|
|
|
1646
|
+
/**
|
|
1647
|
+
* Filter entry that can match a span to control its settings.
|
|
1648
|
+
*/
|
|
1316
1649
|
export interface SpanFilter extends Omit<SpanCreationOptions, "getPropagationInfo"> {
|
|
1317
1650
|
/**
|
|
1318
1651
|
* Specifies the source string used for matching spans.
|
|
@@ -1335,17 +1668,21 @@ export namespace IOInsights {
|
|
|
1335
1668
|
[key: string]: string | number | boolean;
|
|
1336
1669
|
};
|
|
1337
1670
|
}
|
|
1671
|
+
|
|
1672
|
+
// /**
|
|
1673
|
+
// * Configuration for automatic instrumentation of common browser operations.
|
|
1674
|
+
// * Enables automatic tracing of document load, user interactions, fetch requests, and XHR calls.
|
|
1675
|
+
// */
|
|
1676
|
+
// export interface AutoInstrumentationOptions {
|
|
1677
|
+
// documentLoad?: boolean | DocumentLoadInstrumentationConfig;
|
|
1678
|
+
// userInteraction?: boolean | UserInteractionInstrumentationConfig;
|
|
1679
|
+
// fetch?: boolean | FetchInstrumentationConfig;
|
|
1680
|
+
// xhr?: boolean | XMLHttpRequestInstrumentationConfig;
|
|
1681
|
+
// ignoreObservabilityUrls?: boolean;
|
|
1682
|
+
// }
|
|
1338
1683
|
/**
|
|
1339
|
-
*
|
|
1340
|
-
|
|
1341
|
-
*/
|
|
1342
|
-
export interface AutoInstrumentationOptions {
|
|
1343
|
-
documentLoad?: boolean | DocumentLoadInstrumentationConfig;
|
|
1344
|
-
userInteraction?: boolean | UserInteractionInstrumentationConfig;
|
|
1345
|
-
fetch?: boolean | FetchInstrumentationConfig;
|
|
1346
|
-
xhr?: boolean | XMLHttpRequestInstrumentationConfig;
|
|
1347
|
-
ignoreObservabilityUrls?: boolean;
|
|
1348
|
-
}
|
|
1684
|
+
* Settings used to control the sampling probability of spans.
|
|
1685
|
+
*/
|
|
1349
1686
|
export interface SamplingSettings {
|
|
1350
1687
|
/**
|
|
1351
1688
|
* Span name to determine if span will match this sampling setting entry.
|
|
@@ -1505,6 +1842,9 @@ export namespace IOInsights {
|
|
|
1505
1842
|
export interface LogsManager extends Manager<LogsSettings> {
|
|
1506
1843
|
emit(logRecord: LogRecord): Promise<void> | null;
|
|
1507
1844
|
}
|
|
1845
|
+
/**
|
|
1846
|
+
* Builder class used to set up Logs module.
|
|
1847
|
+
*/
|
|
1508
1848
|
export interface LogsManagerBuilder {
|
|
1509
1849
|
build(): LogsManager;
|
|
1510
1850
|
withLogger(logger: Logger): this;
|
|
@@ -1680,6 +2020,9 @@ export namespace IOInsights {
|
|
|
1680
2020
|
enabled?: boolean;
|
|
1681
2021
|
}
|
|
1682
2022
|
|
|
2023
|
+
/**
|
|
2024
|
+
* Level of log entry.
|
|
2025
|
+
*/
|
|
1683
2026
|
export const enum LoggerLogLevel {
|
|
1684
2027
|
NONE = 0,
|
|
1685
2028
|
ERROR = 30,
|
|
@@ -1690,6 +2033,9 @@ export namespace IOInsights {
|
|
|
1690
2033
|
ALL = 9999,
|
|
1691
2034
|
}
|
|
1692
2035
|
|
|
2036
|
+
/**
|
|
2037
|
+
* Log interface that can be passed to library for its own logging.
|
|
2038
|
+
*/
|
|
1693
2039
|
export interface Logger {
|
|
1694
2040
|
level?: LoggerLogLevel;
|
|
1695
2041
|
error(message: string, ...args: unknown[]): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interopio/otel",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.220",
|
|
4
4
|
"description": "io.Insights observability library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"@opentelemetry/resources": "^2.0.0",
|
|
40
40
|
"@opentelemetry/sdk-logs": "^0.200.0",
|
|
41
41
|
"@opentelemetry/sdk-metrics": "^2.0.0",
|
|
42
|
-
"@opentelemetry/sdk-trace-base": "^2.0.0"
|
|
42
|
+
"@opentelemetry/sdk-trace-base": "^2.0.0",
|
|
43
|
+
"log4js": "^6.9.1"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@types/chai": "^4.3.20",
|
|
@@ -49,7 +50,6 @@
|
|
|
49
50
|
"@typescript-eslint/parser": "^7.18.0",
|
|
50
51
|
"chai": "^4.5.0",
|
|
51
52
|
"eslint": "^8.57.1",
|
|
52
|
-
"log4js": "^6.9.1",
|
|
53
53
|
"mocha": "^10.8.2",
|
|
54
54
|
"rimraf": "^5.0.10",
|
|
55
55
|
"typescript": "^4.9.5"
|