@interopio/otel 0.0.122 → 0.0.123

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.
Files changed (2) hide show
  1. package/insights.d.ts +727 -0
  2. package/package.json +1 -1
package/insights.d.ts ADDED
@@ -0,0 +1,727 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ /* eslint-disable max-lines */
3
+ import {
4
+ Attributes,
5
+ Context,
6
+ ContextManager,
7
+ Sampler,
8
+ Span,
9
+ SpanOptions,
10
+ SpanStatus,
11
+ TextMapPropagator,
12
+ TimeInput,
13
+ TracerProvider,
14
+ } from "@opentelemetry/api";
15
+ import { UserInteractionInstrumentationConfig as UserInteractionInstrumentationConfigBase } from "@opentelemetry/instrumentation-user-interaction";
16
+ import { MetricsSettings } from "./src/metrics/settings/types";
17
+
18
+ import { LoggerProvider, LogRecord } from "@opentelemetry/api-logs";
19
+ import {
20
+ OTLPExporterConfigBase,
21
+ OTLPExporterNodeConfigBase,
22
+ } from "@opentelemetry/otlp-exporter-base";
23
+ import {
24
+ BufferConfig,
25
+ SpanExporter,
26
+ SpanProcessor,
27
+ TracerConfig,
28
+ } from "@opentelemetry/sdk-trace-base";
29
+ import { DocumentLoadInstrumentationConfig } from "@opentelemetry/instrumentation-document-load";
30
+ import { FetchInstrumentationConfig } from "@opentelemetry/instrumentation-fetch";
31
+ import { XMLHttpRequestInstrumentationConfig } from "@opentelemetry/instrumentation-xml-http-request";
32
+ import {
33
+ LoggerProviderConfig,
34
+ LogRecordExporter,
35
+ LogRecordProcessor,
36
+ } from "@opentelemetry/sdk-logs";
37
+
38
+ /**
39
+ * @docname Insights
40
+ *
41
+ * @intro
42
+ * io.Insights API.
43
+ */
44
+ export namespace IOConnectInsights {
45
+ export interface API extends Manager<Settings> {
46
+ /**
47
+ * io.insights.metrics
48
+ */
49
+ metrics: MetricsManager;
50
+
51
+ /**
52
+ * io.insights.traces
53
+ */
54
+ traces: TracesManager;
55
+
56
+ /**
57
+ * io.insights.logs
58
+ */
59
+ logs: LogsManager;
60
+ }
61
+
62
+ /**
63
+ * Metrics API.
64
+ */
65
+ export interface MetricsManager extends Manager<MetricsSettings> {
66
+ get(type: MetricType): Metric | undefined;
67
+ getFromSettings(settings: MetricSettings): Metric | undefined;
68
+ }
69
+
70
+ // /**
71
+ // * Traces API.
72
+ // */
73
+ export interface TracesManager extends Manager<TracesSettings> {
74
+ currentTracingState: TracingState | null;
75
+
76
+ /**
77
+ * Called by the application to signify that its startup has completed
78
+ * and no further spans should be nested under the startup trace.
79
+ */
80
+ startupTraceFinished?: () => void;
81
+ setStartupTraceFinished(startupTraceFinished: () => void): void;
82
+
83
+ withSpan<T>(source: string, callback: WithSpanCallback<T>): T;
84
+
85
+ withSpan<T>(
86
+ source: string,
87
+ filteringContext: FilteringContext,
88
+ callback: WithSpanCallback<T>
89
+ ): T;
90
+
91
+ withSpan<T>(
92
+ source: string,
93
+ filteringContext: FilteringContext,
94
+ propagationInfo: PropagationInfo | PropagationInfoCarrier | null,
95
+ callback: WithSpanCallback<T>
96
+ ): T;
97
+
98
+ withSpan<T>(
99
+ source: string,
100
+ filteringContext: FilteringContext,
101
+ propagationInfo: PropagationInfo | PropagationInfoCarrier | null,
102
+ options: WithSpanOptions | null,
103
+ callback: WithSpanCallback<T>
104
+ ): T;
105
+ }
106
+
107
+ export interface LogsManager extends Manager<LogsSettings> {
108
+ emit(logRecord: LogRecord): Promise<void> | null;
109
+ }
110
+
111
+ export interface Manager<TSettings> {
112
+ settings: TSettings;
113
+ started: boolean;
114
+
115
+ start(): Promise<void>;
116
+ stop(): Promise<void>;
117
+ waitForFinalExport(timeoutMs?: number): Promise<void>;
118
+ }
119
+
120
+ export interface Settings {
121
+ /**
122
+ * Whether library is enabled.
123
+ * If disabled, API is still usable, but methods are no-ops.
124
+ */
125
+ enabled: boolean;
126
+ /**
127
+ * Interval in milliseconds to wait for any remaining telemetry data to be exported during shutdown of the platform. This is the maximum awaiting interval and the platform may shutdown before it expires if all telemetry data has already been published.
128
+ */
129
+ finalExportTimeoutMs?: number;
130
+ /**
131
+ * Interval in milliseconds to wait for any remaining telemetry data to be published by any apps before proceeding with the platform shutdown.
132
+ */
133
+ finalExportGracePeriodMs?: number;
134
+
135
+ errorlessMode?: boolean;
136
+ /**
137
+ * If the library should log the settings used to initialize it.
138
+ *
139
+ * @default true
140
+ */
141
+ logSettingsOnStartup?: boolean;
142
+ /**
143
+ * If failure to initialize library will throw upstream error.
144
+ */
145
+ failOnInitError?: boolean;
146
+ /**
147
+ * If provided, this value will be added to the metrics and span attributes
148
+ * and to the span filtering context (see 'filters' in TracesSettings).
149
+ */
150
+ platformVersion?: string;
151
+ /**
152
+ * If provided, this value will be added to the metrics and traces service.name attribute,
153
+ * unless an OTEL service object (e.g. TraceProvider) has been provided to the library with
154
+ * a different setting.
155
+ */
156
+ serviceName?: string;
157
+ /**
158
+ * If provided, this value will be added to the metrics and traces service.instance.id attribute,
159
+ * unless an OTEL service object (e.g. TraceProvider) has been provided to the library with
160
+ * a different setting.
161
+ */
162
+ serviceId?: string;
163
+ /**
164
+ * If provided, this value will be added to the metrics and traces service.version attribute,
165
+ * unless an OTEL service object (e.g. TraceProvider) has been provided to the library with
166
+ * a different setting.
167
+ * attribute.
168
+ */
169
+ serviceVersion?: string;
170
+ /**
171
+ * If provided, this value will be added to the metrics and traces user.id attribute,
172
+ * unless an OTEL service object (e.g. TraceProvider) has been provided to the library with
173
+ * a different setting.
174
+ */
175
+ userId?: string;
176
+
177
+ /**
178
+ * Additional headers to send in HTTP requests, e.g. when using HTTP exporters.
179
+ */
180
+ headers?: { [x: string]: string } | (() => { [x: string]: string });
181
+ /**
182
+ * Additional attributes to add to observability entities (metrics, spans, log entries) by default.
183
+ */
184
+ additionalAttributes?: { [x: string]: unknown } | (() => { [x: string]: unknown });
185
+ /**
186
+ * Additional attributes to add to the observability resource definition.
187
+ */
188
+ additionalResourceAttributes?: { [x: string]: unknown } | (() => { [x: string]: unknown });
189
+
190
+ traces?: TracesSettings;
191
+ metrics?: MetricsSettings;
192
+ logs?: LogsSettings;
193
+ }
194
+ export interface MetricSettings {
195
+ enabled: boolean;
196
+ type: MetricType;
197
+ name: string;
198
+ description: string;
199
+ platformVersion?: string;
200
+ user?: string;
201
+ unit?: string;
202
+ buckets?: number[];
203
+ baseMetricType?: "histogram" | "gauge";
204
+ additionalAttributes?: { [key: string]: unknown } | (() => { [key: string]: unknown });
205
+ }
206
+
207
+ export interface Metric {
208
+ settings: MetricSettings;
209
+ started: boolean;
210
+
211
+ start(): Promise<void>;
212
+ stop(): Promise<void>;
213
+ }
214
+
215
+ export type MetricType =
216
+ /*app: */
217
+ | "app_count"
218
+ | "app_cpu"
219
+ | "app_crash"
220
+ | "app_duration"
221
+ | "app_duration_soft"
222
+ | "app_error"
223
+ | "app_memory"
224
+ | "app_started"
225
+ | "app_startup"
226
+ | "app_stopped"
227
+ /*layout: */
228
+ | "layout_startup"
229
+ /*workspace: */
230
+ | "workspace_count"
231
+ | "workspace_selected"
232
+ | "workspace_started"
233
+ | "workspace_stopped"
234
+ | "workspace_startup_legacy"
235
+ // G4E-9759
236
+ | "workspace_startup"
237
+ | "workspace_startup_frame"
238
+ | "workspace_startup_frame_init"
239
+ | "workspace_startup_frame_page_load"
240
+ | "workspace_startup_frame_workspace_render"
241
+ | "workspace_startup_component"
242
+ | "workspace_startup_apps"
243
+ /*platform: */
244
+ | "platform_error"
245
+ | "platform_startup"
246
+ /*system: */
247
+ | "system_cpu"
248
+ | "system_memory"
249
+ /*custom */
250
+ | "custom_gauge"
251
+ | "custom_observable_gauge"
252
+ | "custom_observable_counter"
253
+ | "custom_observable_up_down_counter"
254
+ | "custom_counter"
255
+ | "custom_histogram"
256
+ | "custom_up_down_counter"
257
+ /*rest: */
258
+ | "null";
259
+
260
+ interface TracingState {
261
+ end(): void;
262
+ /**
263
+ * If false, this is a placeholder object, and all its methods
264
+ * are no-ops, with the possible exception of getPropagationInfo()
265
+ * and injectPropagationInfo()
266
+ */
267
+ enabled: boolean;
268
+ status?: SpanStatus;
269
+ level: keyof typeof SpanVerbosity;
270
+ addData(level: SpanVerbosity | keyof typeof SpanVerbosity, data: object): void;
271
+ source: string;
272
+ id?: string;
273
+ traceId?: string;
274
+ endSpan(): Promise<void>;
275
+ context?: Context;
276
+ span?: Span;
277
+ /**
278
+ * Gets the propagation info for the current span (see https://www.w3.org/TR/trace-context/#tracestate-field)
279
+ * @returns the propagation info, if a span is currently active
280
+ */
281
+ getPropagationInfo: () => PropagationInfo | null;
282
+ /**
283
+ * Sets a hidden property in the object that can be used to restore propagation
284
+ * information after serialization and deserialization (see withSpan 'propagationInfo' argument
285
+ * and Traces.extractPropagationInfo() method).
286
+ * @param carrier the object to populate
287
+ */
288
+ injectPropagationInfo: (carrier: PropagationInfoCarrier & object) => void;
289
+ addEvent: (
290
+ name: string,
291
+ attributesOrStartTime?: Attributes | TimeInput,
292
+ startTime?: TimeInput
293
+ ) => this;
294
+ recordException: Span["recordException"];
295
+ isRecording: Span["isRecording"];
296
+ updateName: (name: string) => this;
297
+ spanContext: Span["spanContext"] | (() => undefined);
298
+ }
299
+
300
+ export interface TracesSettings {
301
+ /**
302
+ * Name of span hit counter metric, set to null to disable.
303
+ *
304
+ * Defaults to 'insights_trace_count'.
305
+ */
306
+ countMetric?: string;
307
+ /**
308
+ * Name of span duration histogram metric, set to null to disable.
309
+ *
310
+ * Defaults to 'insights_trace_duration'.
311
+ */
312
+ durationMetric?: string;
313
+ /**
314
+ * Name of span result counter metric, set to null to disable.
315
+ *
316
+ * Defaults to 'insights_trace_result'.
317
+ */
318
+ resultMetric?: string;
319
+
320
+ /**
321
+ * Whether tracing functionality is enabled.
322
+ * If disabled, API is still usable, but methods are no-ops.
323
+ *
324
+ * Defaults to 'false'.
325
+ */
326
+ enabled: boolean;
327
+
328
+ /**
329
+ * Array of filter entries used to determine whether
330
+ * a particular operation will create a tracing span, and
331
+ * what verbosity level will apply to attributes added
332
+ * to that span.
333
+ *
334
+ * If no matching filter entry is found,
335
+ * the settings from 'default' are used.
336
+ */
337
+ filters?: SpanFilter[];
338
+ /**
339
+ * If true, use a predefined list of filters for well-known
340
+ * platform traces.
341
+ *
342
+ * Defaults to true.
343
+ */
344
+ useDefaultFilters?: boolean;
345
+
346
+ defaultFilters?: SpanFilter[];
347
+ /**
348
+ * Array of sampling setting entries used to determine
349
+ * whether a span will be sampled.
350
+ *
351
+ * If no matching sampling setting entry is found,
352
+ * the settings from 'defaults' are used.
353
+ */
354
+ sampling?: SamplingSettings[];
355
+ /**
356
+ * Default settings if appropriate entries aren't found
357
+ * in 'filters' and 'sampling' collections.
358
+ */
359
+ defaults?: SpanCreationOptions;
360
+ /**
361
+ * If 'true', the library will use the ContextManager provided
362
+ * by the active OTEL SDK to manage and derive propagation information
363
+ * to ensure spans created across asynchronous operations are properly
364
+ * nested.
365
+ *
366
+ * Otherwise, use 'Traces.currentTracingState' to set and retrieve propagation
367
+ * info across asynchronous operations manually.
368
+ *
369
+ * See https://opentelemetry.io/docs/languages/js/propagation/ and
370
+ * https://opentelemetry.io/docs/languages/js/context/#context-manager for
371
+ * more information.
372
+ */
373
+ useOTELContextManager?: boolean;
374
+ /**
375
+ * If an OTEL TraceProvider isn't provided to the library,
376
+ * it will initialize its own.
377
+ *
378
+ * If 'url' is specified, TracerProvider will
379
+ * have an OTLPTraceExporter using this destination URL.
380
+ */
381
+ url?: string;
382
+ /**
383
+ * Whether the clickstream trace will be enabled.
384
+ *
385
+ * @default false
386
+ */
387
+ clickstream?: boolean | "nested" | "sibling";
388
+ /**
389
+ * Whether the user journey trace will be enabled.
390
+ *
391
+ * @default true
392
+ */
393
+ userJourney?: boolean | "nested" | "sibling";
394
+ /**
395
+ * How long after application startup will any traced operations
396
+ * automatically be nested under the application startup trace.
397
+ */
398
+ startupParentSpanTimeoutMs?: number;
399
+ /**
400
+ * Called by the application to signify that its startup has completed
401
+ * and no further spans should be nested under the startup trace.
402
+ */
403
+ startupTraceFinished?: () => void;
404
+
405
+ /**
406
+ * If an OTEL TraceProvider isn't provided to the library,
407
+ * it will initialize its own.
408
+ *
409
+ * If 'url' is specified, TracerProvider will
410
+ * have an OTLPTraceExporter with 'url' as detination URL and
411
+ * 'otlpExporterConfig' as additional * config.
412
+ */
413
+ otlpExporterConfig?: OTLPExporterNodeConfigBase;
414
+
415
+ tracerProviderConfig?: TracerConfig;
416
+
417
+ batchSpanProcessorConfig?: BufferConfig;
418
+
419
+ autoInstrumentations?: AutoInstrumentationOptions;
420
+
421
+ /**
422
+ * If an OTEL TraceProvider isn't provided to the library,
423
+ * it will initialize its own.
424
+ *
425
+ * If 'console' is 'true', TracerProvider will
426
+ * have a ConsoleTraceExporter.
427
+ */
428
+ console?: boolean;
429
+
430
+ /**
431
+ * Additional headers to send in HTTP requests, e.g. when using HTTP exporters.
432
+ */
433
+ headers?: { [x: string]: string } | (() => { [x: string]: string });
434
+ addResourceAttributesToAttributes?: boolean;
435
+ /**
436
+ * Additional attributes to add to observability entities (metrics, spans, log entries) by default.
437
+ */
438
+ additionalAttributes?: { [x: string]: unknown } | (() => { [x: string]: unknown });
439
+ /**
440
+ * Additional attributes to add to the observability resource definition.
441
+ */
442
+ additionalResourceAttributes?: { [x: string]: unknown } | (() => { [x: string]: unknown });
443
+
444
+ tracerProvider?: () => TracerProvider;
445
+ samplerGetter?: (defaultSampler: Sampler) => Sampler;
446
+ spanProcessors?: () => SpanProcessor[];
447
+ spanExporters?: () => SpanExporter[];
448
+ propagator?: () => TextMapPropagator;
449
+ contextManager?: () => ContextManager;
450
+ providerRegistrationSettings?: () => {
451
+ propagator?: TextMapPropagator;
452
+ contextManager?: ContextManager;
453
+ };
454
+ }
455
+
456
+ export type WithSpanCallback<T> = (tracingState: TracingState) => T;
457
+
458
+ export interface PropagationInfo {
459
+ traceparent?: string;
460
+ tracestate?: string;
461
+ forceTracing?: boolean;
462
+ }
463
+ export interface PropagationInfoCarrier {
464
+ __interopIOTracePropagationInfo?: PropagationInfo;
465
+ }
466
+
467
+ export type PropagationInfoCallback = (
468
+ source: string,
469
+ fullFilteringContext: FilteringContext
470
+ ) => PropagationInfo | null;
471
+
472
+ export type FilteringContext = {
473
+ app?: string;
474
+ user?: string;
475
+ host?: string;
476
+ serviceName?: string;
477
+ serviceId?: string;
478
+ platformVersion?: string;
479
+ serviceVersion?: string;
480
+ userId?: string;
481
+ } & Record<string, any>;
482
+
483
+ export enum SpanVerbosity {
484
+ OFF,
485
+ LOWEST,
486
+ DIAGNOSTIC,
487
+ DEBUG,
488
+ INFO,
489
+ WARN,
490
+ HIGHEST,
491
+ }
492
+ export interface WithSpanOptions extends Omit<SpanCreationOptions, "sample"> {
493
+ defaultFilters?: SpanFilter[];
494
+ }
495
+
496
+ export interface SpanCreationOptions {
497
+ /**
498
+ * Whether the span will be created or will be a no-op. See 'Filter'.
499
+ *
500
+ * Defaults to 'true'.
501
+ */
502
+ enabled?: boolean;
503
+ /**
504
+ * If a tracing span is disabled by filter, setting this to "true" will stop the propagation
505
+ * of trace nesting info across it.
506
+ */
507
+ stopPropagationIfSpanIsDisabled?: boolean;
508
+ /**
509
+ * Default span attribute verbosity level. See 'Filter'.
510
+ *
511
+ * Defaults to 'INFO'.
512
+ */
513
+ level?: keyof typeof SpanVerbosity;
514
+ /**
515
+ * Whether the filtering context will be added as span attributes
516
+ * to the span. See 'Filter'.
517
+ *
518
+ * Defaults to 'true'.
519
+ */
520
+ addContextToTrace?: boolean;
521
+ /**
522
+ * Whether the span's status will be set to OK on completion, if
523
+ * it's still UNSET. See 'Filter'.
524
+ *
525
+ * Defaults to 'false'.
526
+ */
527
+ autoSetSuccessStatus?: boolean;
528
+ /**
529
+ * Default sampling setting/probability. See 'SamplingSettings'.
530
+ *
531
+ * Defaults to 'true'.
532
+ */
533
+ sample?: number | boolean;
534
+ /**
535
+ * Whether the span will not inject its propagation info into data
536
+ * transfer objects for span nesting across system boundaries.
537
+ *
538
+ * Defaults to 'false'.
539
+ */
540
+ disablePropagation?: boolean;
541
+ /**
542
+ * Forces the span to create a new trace.
543
+ */
544
+ disableNesting?: boolean;
545
+
546
+ log?: boolean;
547
+
548
+ logOnDisabledSpans?: boolean;
549
+
550
+ /**
551
+ * Whether the span will be counted in the insights_trace_count metric. See TracesSettings.countMetric.
552
+ *
553
+ * Defaults to 'false'.
554
+ */
555
+ countMetric?: boolean;
556
+ /**
557
+ * Whether the span will be counted in the insights_trace_count metric if disabled. See TracesSettings.countMetric.
558
+ */
559
+ countMetricOnDisabledSpans?: boolean;
560
+ /**
561
+ * Whether the span will be counted in the insights_trace_result metric. See TracesSettings.resultMetric.
562
+ *
563
+ * Defaults to 'false'.
564
+ */
565
+ resultMetric?: boolean;
566
+ /**
567
+ * Whether the span will be counted in the insights_trace_result metric if disabled. See TracesSettings.resultMetric.
568
+ */
569
+ resultMetricOnDisabledSpans?: boolean;
570
+ /**
571
+ * Whether the span will be counted in the insights_trace_duration metric. See TracesSettings.durationtMetric.
572
+ *
573
+ * Defaults to 'false'.
574
+ */
575
+ durationMetric?: boolean;
576
+ /**
577
+ * Whether the span will be counted in the insights_trace_count metric if disabled. See TracesSettings.durationMetric.
578
+ */
579
+ durationMetricOnDisabledSpans?: boolean;
580
+ /**
581
+ * Whether the span will be able to start a new trace. If false, it will only
582
+ * be able to be added to an existing trace.
583
+ *
584
+ * Defaults to 'true'.
585
+ */
586
+ canBeRoot?: boolean;
587
+ /**
588
+ * How deep addData method should recurse into objects when adding
589
+ * attributes to spans.
590
+ *
591
+ * Defaults to 3.
592
+ */
593
+ maxAttributeDepth?: number;
594
+ /**
595
+ * If true, any child spans (including nested spans across sytem boundaries)
596
+ * will be forced to be traced, even if their span filter configuration
597
+ * is set to not enabled.
598
+ *
599
+ * Defaults to 'false'.
600
+ */
601
+ forceChildTracing?: boolean;
602
+ /**
603
+ * If specified, spans whose duration is lower than this will not be sampled.
604
+ */
605
+ minDurationMs?: number;
606
+
607
+ getPropagationInfo?: PropagationInfoCallback;
608
+
609
+ /**
610
+ * OTEL span options
611
+ */
612
+ otelSpanOptions?: SpanOptions;
613
+
614
+ overrideDefaultFilters?: boolean;
615
+ }
616
+
617
+ export interface SpanFilter extends Omit<SpanCreationOptions, "getPropagationInfo"> {
618
+ /**
619
+ * Specifies the source string used for matching spans.
620
+ * Spans match only if their source equals this value, or
621
+ * if their source starts with '<source>.' (e.g. my.api.foo
622
+ * starts with my.api).
623
+ *
624
+ * Start string with "#" for case-insensitive regex match.
625
+ */
626
+ source?: string;
627
+ /**
628
+ * Specifies the filtering context values used for matching spans.
629
+ * Spans match only if all the values in this object match
630
+ * the context values returned by the context getter callback
631
+ * and the filteringContext config property.
632
+ *
633
+ * Start strings with "#" for case-insensitive regex match.
634
+ */
635
+ context?: {
636
+ [key: string]: string | number | boolean;
637
+ };
638
+ }
639
+ export interface AutoInstrumentationOptions {
640
+ documentLoad?: boolean | DocumentLoadInstrumentationConfig;
641
+ userInteraction?: boolean | UserInteractionInstrumentationConfig;
642
+ fetch?: boolean | FetchInstrumentationConfig;
643
+ xhr?: boolean | XMLHttpRequestInstrumentationConfig;
644
+ ignoreObservabilityUrls?: boolean;
645
+ }
646
+ export interface SamplingSettings {
647
+ /**
648
+ * Span name to determine if span will match this sampling setting entry.
649
+ * Start string with "#" for case-insensitive regex match
650
+ */
651
+ name?: string;
652
+ /**
653
+ * Span attributes that determine if span will match this sampling setting entry.
654
+ * Useful e.g. for checking otel.library.name/otel.scope.name attribute to filter
655
+ * auto-instrumentated spans.
656
+ * Start strings with "#" for case-insensitive regex match.
657
+ */
658
+ attributes?: { [key: string]: string | number | boolean };
659
+ /**
660
+ * Context values that determine if span will match this sampling setting entry.
661
+ * 'Context' here refers to the object returned from the 'contextGetter' callback at the
662
+ * time of sampling, not the OTEL context concept.
663
+ * This is useful for sampling based on the current client environment - current user, application,
664
+ * server node, time of day, etc.
665
+ * Start strings with "#" for case-insensitive regex match.
666
+ */
667
+ context?: { [key: string]: string | number | boolean };
668
+ /**
669
+ * Probability that span will be sampled, based on its traceId
670
+ * Spans from the same trace will always either all be sampled, or none will,
671
+ * provided they all have the same sampling probability.
672
+ * If true: will be sampled
673
+ * If false: will not be sampled
674
+ * If number between 0 and 1: has this probability of being sampled.
675
+ * Precision: 3 decimal digits
676
+ */
677
+ sample: number | boolean;
678
+ }
679
+
680
+ export interface UserInteractionInstrumentationConfig
681
+ extends UserInteractionInstrumentationConfigBase {
682
+ throttleIntervalMs?: number;
683
+ }
684
+
685
+ export interface LogsSettings {
686
+ enabled: boolean;
687
+ url?: string;
688
+
689
+ keepAlive?: boolean;
690
+ exporterSettings?: OTLPExporterConfigBase;
691
+ batchSettings?: BufferConfig;
692
+ providerSettings?: LoggerProviderConfig;
693
+
694
+ loggerProvider?: LoggerProvider;
695
+ logProcessors?: LogRecordProcessor[];
696
+ logExporters?: LogRecordExporter[];
697
+
698
+ maxAttributeDepth?: number;
699
+ filters?: LogFilter[];
700
+ defaults?: LogOptions;
701
+
702
+ /**
703
+ * Additional headers to send in HTTP requests, e.g. when using HTTP exporters.
704
+ */
705
+ headers?: { [x: string]: string } | (() => { [x: string]: string });
706
+ addResourceAttributesToAttributes?: boolean;
707
+ /**
708
+ * Additional attributes to add to observability entities (metrics, spans, log entries) by default.
709
+ */
710
+ additionalAttributes?: { [x: string]: unknown } | (() => { [x: string]: unknown });
711
+ /**
712
+ * Additional attributes to add to the observability resource definition.
713
+ */
714
+ additionalResourceAttributes?: { [x: string]: unknown } | (() => { [x: string]: unknown });
715
+ }
716
+
717
+ export interface LogFilter extends LogOptions {
718
+ categoryName?: string;
719
+ severity?: "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL";
720
+ bodyRegex?: string;
721
+ }
722
+ export interface LogOptions {
723
+ allowedAttributes?: string[];
724
+ hideRegex?: string;
725
+ enabled?: boolean;
726
+ }
727
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interopio/otel",
3
- "version": "0.0.122",
3
+ "version": "0.0.123",
4
4
  "description": "otel library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",