@conduit-client/service-instrumentation 5.67.0-dev1

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/LICENSE.txt ADDED
@@ -0,0 +1,27 @@
1
+ *Attorney/Client Privileged + Confidential*
2
+
3
+ Terms of Use for Public Code (Non-OSS)
4
+
5
+ *NOTE:* Before publishing code under this license/these Terms of Use, please review https://salesforce.quip.com/WFfvAMKB18AL and confirm that you’ve completed all prerequisites described therein. *These Terms of Use may not be used or modified without input from IP and Product Legal.*
6
+
7
+ *Terms of Use*
8
+
9
+ Copyright 2022 Salesforce, Inc. All rights reserved.
10
+
11
+ These Terms of Use govern the download, installation, and/or use of this software provided by Salesforce, Inc. (“Salesforce”) (the “Software”), were last updated on April 15, 2022, ** and constitute a legally binding agreement between you and Salesforce. If you do not agree to these Terms of Use, do not install or use the Software.
12
+
13
+ Salesforce grants you a worldwide, non-exclusive, no-charge, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute the Software and derivative works subject to these Terms. These Terms shall be included in all copies or substantial portions of the Software.
14
+
15
+ Subject to the limited rights expressly granted hereunder, Salesforce reserves all rights, title, and interest in and to all intellectual property subsisting in the Software. No rights are granted to you hereunder other than as expressly set forth herein. Users residing in countries on the United States Office of Foreign Assets Control sanction list, or which are otherwise subject to a US export embargo, may not use the Software.
16
+
17
+ Implementation of the Software may require development work, for which you are responsible. The Software may contain bugs, errors and incompatibilities and is made available on an AS IS basis without support, updates, or service level commitments.
18
+
19
+ Salesforce reserves the right at any time to modify, suspend, or discontinue, the Software (or any part thereof) with or without notice. You agree that Salesforce shall not be liable to you or to any third party for any modification, suspension, or discontinuance.
20
+
21
+ You agree to defend Salesforce against any claim, demand, suit or proceeding made or brought against Salesforce by a third party arising out of or accruing from (a) your use of the Software, and (b) any application you develop with the Software that infringes any copyright, trademark, trade secret, trade dress, patent, or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy (each a “Claim Against Salesforce”), and will indemnify Salesforce from any damages, attorney fees, and costs finally awarded against Salesforce as a result of, or for any amounts paid by Salesforce under a settlement approved by you in writing of, a Claim Against Salesforce, provided Salesforce (x) promptly gives you written notice of the Claim Against Salesforce, (y) gives you sole control of the defense and settlement of the Claim Against Salesforce (except that you may not settle any Claim Against Salesforce unless it unconditionally releases Salesforce of all liability), and (z) gives you all reasonable assistance, at your expense.
22
+
23
+ WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE SOFTWARE IS NOT SUPPORTED AND IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL SALESFORCE HAVE ANY LIABILITY FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR DAMAGES BASED ON LOST PROFITS, DATA, OR USE, IN CONNECTION WITH THE SOFTWARE, HOWEVER CAUSED AND WHETHER IN CONTRACT, TORT, OR UNDER ANY OTHER THEORY OF LIABILITY, WHETHER OR NOT YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
24
+
25
+ These Terms of Use shall be governed exclusively by the internal laws of the State of California, without regard to its conflicts of laws rules. Each party hereby consents to the exclusive jurisdiction of the state and federal courts located in San Francisco County, California to adjudicate any dispute arising out of or relating to these Terms of Use and the download, installation, and/or use of the Software. Except as expressly stated herein, these Terms of Use constitute the entire agreement between the parties, and supersede all prior and contemporaneous agreements, proposals, or representations, written or oral, concerning their subject matter. No modification, amendment, or waiver of any provision of these Terms of Use shall be effective unless it is by an update to these Terms of Use that Salesforce makes available, or is in writing and signed by the party against whom the modification, amendment, or waiver is to be asserted.
26
+
27
+ _*Data Privacy*_: Salesforce may collect, process, and store device, system, and other information related to your use of the Software. This information includes, but is not limited to, IP address, user metrics, and other data (“Usage Data”). Salesforce may use Usage Data for analytics, product development, and marketing purposes. You acknowledge that files generated in conjunction with the Software may contain sensitive or confidential data, and you are solely responsible for anonymizing and protecting such data.
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ This software is provided as-is with no support provided.
2
+
3
+ # Luvio Instrumentation Service
4
+
5
+ This package re-exports the instrumentation service interface types and implementations.
6
+
7
+ ## Package Structure
8
+
9
+ The instrumentation service is divided into the following packages:
10
+
11
+ - [`-client/service-instrumentation-types`](../instrumentation-types): Type definitions
12
+ - [`-client/service-instrumentation-noop`](../instrumentation-noop): A no-op implementation
13
+ - [`-client/service-instrumentation-o11y`](../instrumentation-o11y): An implementation using the O11y library
14
+
15
+ This main package (`-client/service-instrumentation`) re-exports all the types and implementations to maintain backward compatibility.
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ npm install -client/service-instrumentation
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ```js
26
+ // Using the noop implementation
27
+ import { buildNoopInstrumentationServiceDescriptor } from '@conduit-client/service-instrumentation/v1';
28
+
29
+ const noopService = buildNoopInstrumentationServiceDescriptor();
30
+
31
+ // Using the o11y implementation
32
+ import { buildO11yInstrumentationServiceDescriptor } from '@conduit-client/service-instrumentation/v1';
33
+ import { logger } from '@conduit-client/logger';
34
+
35
+ const o11yService = buildO11yInstrumentationServiceDescriptor(logger);
36
+ ```
37
+
38
+ # Instrumentation Service
39
+
40
+ We are about standards around here. OpenTelemetry is the standard. We are also about exposing what makes sense from their API for a library. We want to trace and record metrics. We want to log too, but that component is [under development](https://opentelemetry.io/docs/languages/js/) (as of March 2024), so for the sake of stability we will hold off on that.
41
+
42
+ ## No-Op Implementation
43
+
44
+ We provide a no-op implementation OOTB, so things run smoothly when an actual implementation is not provided.
45
+
46
+ Use `buildNoopInstrumentationService` when building out your services.
47
+
48
+ ```ts
49
+ import { buildNoopInstrumentationService } from '@conduit-client/service-instrumentation/v1';
50
+ ```
51
+
52
+ _Aside: We originally tried using the no-op implementations provided by the OTel API, but it came with a cost of 7kb, which was a little rich for our taste, especially when this service exposes a relatively small subset of the API. I'm sure there is a way to scope it down, but for now we make due with our own_
53
+
54
+ ## Adding to the interface
55
+
56
+ So you realized we **have** to have [`DiagAPI`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_api.DiagAPI.html) as part of the API? (We probably should add it at some point)
57
+
58
+ The process is pretty simple, albeit tedious (with the handrolling of a No-Op implementation and the unit-testing). What's important is that we are only pulling in the portion of the API that makes sense. For example, with the [TraceAPI](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_api.TraceAPI.html), `setGlobalTracerProvider` is the responsibility of the runtime application, and we shouldn't have the power to set it ourselves, so we leave that out. With that in mind, there are only a few steps to take.
59
+
60
+ 1. Create a type from the OTel API you'd like to include, use `Pick<>` to select what makes sense
61
+ 2. Add it to the service interface
62
+ 3. Create a No-Op implementation, along with unit tests to keep our code coverage happy
63
+ 4. Update the `buildNoopInstrumentationService` function we export with the service
64
+
65
+ Checkout [this PR](https://github.com/salesforce-experience-platform-emu/luvio-next/pull/171) that adds the MetricsAPI to the service interface for guidance.
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
File without changes
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export { type InstrumentationService, type InstrumentationServiceDescriptor, type LuvioOTelTraceAPI, type LuvioOTelMetricsAPI, type NamedInstrumentationService, type Counter, type Histogram, type Meter, type AttributeValue, type InstrumentationAttributes, } from '@conduit-client/service-instrumentation-types/v1';
2
+ export { buildServiceDescriptor as buildNoopInstrumentationServiceDescriptor } from '@conduit-client/service-instrumentation-noop/v1';
3
+ export { buildServiceDescriptor as buildO11yInstrumentationServiceDescriptor } from '@conduit-client/service-instrumentation-o11y/v1';
@@ -0,0 +1,426 @@
1
+ /*!
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { getInstrumentation } from "o11y/client";
7
+ /*!
8
+ * Copyright (c) 2022, Salesforce, Inc.,
9
+ * All rights reserved.
10
+ * For full license text, see the LICENSE.txt file
11
+ */
12
+ class NoopOTelTraceAPI {
13
+ getTracer(_name, _version, _options) {
14
+ return new NoopTracer();
15
+ }
16
+ }
17
+ class NoopTracer {
18
+ startSpan(_name, _options, _context) {
19
+ return new NoopSpan();
20
+ }
21
+ startActiveSpan(name, options, context, fn) {
22
+ let opts;
23
+ let ctx;
24
+ let fun;
25
+ if (typeof options === "function") {
26
+ fun = options;
27
+ } else {
28
+ opts = options;
29
+ if (typeof context === "function") {
30
+ fun = context;
31
+ } else {
32
+ ctx = context;
33
+ fun = fn;
34
+ }
35
+ }
36
+ const span = this.startSpan(name, opts, ctx);
37
+ try {
38
+ return fun(span);
39
+ } finally {
40
+ span.end();
41
+ }
42
+ }
43
+ }
44
+ class NoopSpan {
45
+ spanContext() {
46
+ return {
47
+ spanId: "noopSpanId",
48
+ traceId: "noopTraceId",
49
+ traceFlags: 0
50
+ };
51
+ }
52
+ setAttribute(_key, _value) {
53
+ return this;
54
+ }
55
+ setAttributes(_attributes) {
56
+ return this;
57
+ }
58
+ addEvent(_name, _attributesOrStartTime, _startTime) {
59
+ return this;
60
+ }
61
+ setStatus(_status) {
62
+ return this;
63
+ }
64
+ updateName(_name) {
65
+ return this;
66
+ }
67
+ end(_endTime) {
68
+ return;
69
+ }
70
+ isRecording() {
71
+ return false;
72
+ }
73
+ recordException(_exception, _time) {
74
+ return;
75
+ }
76
+ }
77
+ class NoopOTelMetricsAPI {
78
+ getMeter(__name, _version, __options) {
79
+ return new NoopMeter();
80
+ }
81
+ }
82
+ class NoopMeter {
83
+ createHistogram(_name, _options) {
84
+ return new NoopHistogram();
85
+ }
86
+ createCounter(_name, _options) {
87
+ return new NoopCounter();
88
+ }
89
+ createUpDownCounter(_name, _options) {
90
+ return new NoopUpDownCounter();
91
+ }
92
+ createObservableGauge(_name, _options) {
93
+ return new NoopObservableGuage();
94
+ }
95
+ createObservableCounter(_name, _options) {
96
+ return new NoopObservableCounter();
97
+ }
98
+ createObservableUpDownCounter(_name, _options) {
99
+ return new NoopObservableUpDownCounter();
100
+ }
101
+ addBatchObservableCallback(_callback, _observables) {
102
+ return;
103
+ }
104
+ removeBatchObservableCallback(_callback, _observables) {
105
+ return;
106
+ }
107
+ }
108
+ class NoopCounter {
109
+ add(_value, _attributes, _context) {
110
+ return;
111
+ }
112
+ }
113
+ class NoopHistogram {
114
+ record(_value, _attributes, _context) {
115
+ return;
116
+ }
117
+ }
118
+ class NoopUpDownCounter {
119
+ add(_value, _attributes, _context) {
120
+ return;
121
+ }
122
+ }
123
+ class NoopObservableCounter {
124
+ addCallback(_callback) {
125
+ return;
126
+ }
127
+ removeCallback(_callback) {
128
+ return;
129
+ }
130
+ }
131
+ class NoopObservableGuage {
132
+ addCallback(_callback) {
133
+ return;
134
+ }
135
+ removeCallback(_callback) {
136
+ return;
137
+ }
138
+ }
139
+ class NoopObservableUpDownCounter {
140
+ addCallback(_callback) {
141
+ return;
142
+ }
143
+ removeCallback(_callback) {
144
+ return;
145
+ }
146
+ }
147
+ function buildServiceDescriptor$1() {
148
+ return {
149
+ type: "instrumentation",
150
+ version: "1.0",
151
+ service: {
152
+ trace: new NoopOTelTraceAPI(),
153
+ metrics: new NoopOTelMetricsAPI(),
154
+ currentTimeMs: () => 0
155
+ }
156
+ };
157
+ }
158
+ /*!
159
+ * Copyright (c) 2022, Salesforce, Inc.,
160
+ * All rights reserved.
161
+ * For full license text, see the LICENSE.txt file
162
+ */
163
+ class O11yOTelTraceAPI {
164
+ constructor(services) {
165
+ this.services = services;
166
+ }
167
+ getTracer(name, _version, _options) {
168
+ const o11yInstrumentation = getInstrumentation(name);
169
+ return new O11yTracer(o11yInstrumentation, this.services.logger);
170
+ }
171
+ }
172
+ class O11yTracer {
173
+ constructor(o11yInstrumentation, logger) {
174
+ this.o11yInstrumentation = o11yInstrumentation;
175
+ this.logger = logger;
176
+ }
177
+ startSpan(name, _options, context) {
178
+ const traceId = context == null ? void 0 : context.getValue(Symbol.for("traceId"));
179
+ const spanId = context == null ? void 0 : context.getValue(Symbol.for("spanId"));
180
+ const traceFlags = context == null ? void 0 : context.getValue(Symbol.for("traceFlags"));
181
+ let spanContext = void 0;
182
+ if (traceId !== void 0 && spanId !== void 0 && traceFlags !== void 0) {
183
+ spanContext = {
184
+ traceId,
185
+ spanId,
186
+ traceFlags
187
+ };
188
+ }
189
+ const activityOptions = spanContext === void 0 ? void 0 : {
190
+ instrumentationContext: {
191
+ rootId: spanContext.traceId,
192
+ isRootActivitySampled: spanContext.traceFlags === 1,
193
+ parentId: spanId
194
+ }
195
+ };
196
+ const activity = this.o11yInstrumentation.startActivity(name, activityOptions);
197
+ return new O11ySpan(activity, this.logger);
198
+ }
199
+ startActiveSpan(name, options, context, fn) {
200
+ let opts;
201
+ let ctx;
202
+ let fun;
203
+ if (typeof options === "function") {
204
+ fun = options;
205
+ } else {
206
+ opts = options;
207
+ if (typeof context === "function") {
208
+ fun = context;
209
+ } else {
210
+ ctx = context;
211
+ fun = fn;
212
+ }
213
+ }
214
+ const span = this.startSpan(name, opts, ctx);
215
+ return fun(span);
216
+ }
217
+ }
218
+ class O11ySpan {
219
+ constructor(activity, logger) {
220
+ this.activity = activity;
221
+ this.logger = logger;
222
+ this._isRecording = true;
223
+ this.attributes = {};
224
+ }
225
+ spanContext() {
226
+ return {
227
+ traceId: this.activity.getRootId(),
228
+ spanId: this.activity.getId(),
229
+ traceFlags: this.activity.getIsSampled() ? 1 : 0
230
+ };
231
+ }
232
+ setAttribute(key, value) {
233
+ this.attributes[key] = value;
234
+ return this;
235
+ }
236
+ setAttributes(attributes) {
237
+ this.attributes = { ...this.attributes, ...attributes };
238
+ return this;
239
+ }
240
+ addEvent(_name, _attributesOrStartTime, _startTime) {
241
+ this.logger.warn("O11ySpan does not support addEvents.");
242
+ return this;
243
+ }
244
+ setStatus(_status) {
245
+ this.logger.warn("O11ySpan does not support setStatus.");
246
+ return this;
247
+ }
248
+ updateName(_name) {
249
+ this.logger.warn("O11ySpan does not support updateName.");
250
+ return this;
251
+ }
252
+ end(endTime) {
253
+ let endTimeInternal = endTime;
254
+ try {
255
+ if (typeof endTimeInternal !== "number") {
256
+ this.logger.warn("O11ySpan does not support non number endTime override.");
257
+ endTimeInternal = void 0;
258
+ }
259
+ this.activity.stop(
260
+ void 0,
261
+ void 0,
262
+ endTimeInternal ? { perfStopOverride: endTimeInternal } : void 0
263
+ );
264
+ } finally {
265
+ this._isRecording = false;
266
+ }
267
+ return;
268
+ }
269
+ isRecording() {
270
+ return this._isRecording;
271
+ }
272
+ recordException(exception, _time) {
273
+ this.activity.error(exception);
274
+ }
275
+ }
276
+ class O11yOTelMetricsAPI {
277
+ constructor(services) {
278
+ this.services = services;
279
+ }
280
+ getMeter(name, _version, __options) {
281
+ const o11yInstrumentation = getInstrumentation(name);
282
+ return new O11yMeter(o11yInstrumentation, this.services.logger);
283
+ }
284
+ }
285
+ class O11yMeter {
286
+ constructor(o11yInstrumentation, logger) {
287
+ this.o11yInstrumentation = o11yInstrumentation;
288
+ this.logger = logger;
289
+ }
290
+ createHistogram(name, _options) {
291
+ return new O11yHistogram(name, this.o11yInstrumentation, this.logger);
292
+ }
293
+ createCounter(name, options) {
294
+ if (options) {
295
+ this.logger.warn("counter options not supported in O11y instrumentation");
296
+ }
297
+ return new O11yCounter(name, this.o11yInstrumentation, this.logger);
298
+ }
299
+ createUpDownCounter(_name, _options) {
300
+ return new O11yUpDownCounter(this.logger);
301
+ }
302
+ createObservableGauge(_name, _options) {
303
+ return new O11yObservableGuage(this.logger);
304
+ }
305
+ createObservableCounter(_name, _options) {
306
+ return new O11yObservableCounter(this.logger);
307
+ }
308
+ createObservableUpDownCounter(_name, _options) {
309
+ return new O11yObservableUpDownCounter(this.logger);
310
+ }
311
+ addBatchObservableCallback(_callback, _observables) {
312
+ this.logger.warn("addBatchObservableCallback not supported yet");
313
+ }
314
+ removeBatchObservableCallback(_callback, _observables) {
315
+ this.logger.warn("removeBatchObservableCallback not supported yet");
316
+ }
317
+ }
318
+ class O11yCounter {
319
+ constructor(name, o11yInstrumentation, logger) {
320
+ this.name = name;
321
+ this.o11yInstrumentation = o11yInstrumentation;
322
+ this.logger = logger;
323
+ }
324
+ add(value, attributes, _context) {
325
+ if (value < 0) {
326
+ this.logger.warn(`Counter values must be non-negative. Got ${value}.`);
327
+ return;
328
+ }
329
+ this.o11yInstrumentation.incrementCounter(
330
+ this.name,
331
+ value,
332
+ void 0,
333
+ sanitizeAttributes(attributes)
334
+ );
335
+ }
336
+ }
337
+ class O11yHistogram {
338
+ constructor(name, o11yInstrumentation, logger) {
339
+ this.name = name;
340
+ this.o11yInstrumentation = o11yInstrumentation;
341
+ this.logger = logger;
342
+ }
343
+ record(value, attributes, _context) {
344
+ if (value < 0) {
345
+ this.logger.warn(`Histogram values must be non-negative. Got ${value}.`);
346
+ return;
347
+ }
348
+ this.o11yInstrumentation.trackValue(
349
+ this.name,
350
+ value,
351
+ void 0,
352
+ sanitizeAttributes(attributes)
353
+ );
354
+ }
355
+ }
356
+ class O11yUpDownCounter {
357
+ constructor(logger) {
358
+ this.logger = logger;
359
+ }
360
+ add(_value, _attributes, _context) {
361
+ this.logger.warn("O11yUpDownCounter not supported yet.");
362
+ }
363
+ }
364
+ class O11yObservableCounter {
365
+ constructor(logger) {
366
+ this.logger = logger;
367
+ }
368
+ addCallback(_callback) {
369
+ this.logger.warn("O11yObservableCounter not supported yet. Defaulting to noop.");
370
+ }
371
+ removeCallback(_callback) {
372
+ this.logger.warn("O11yObservableCounter not supported yet. Defaulting to noop.");
373
+ }
374
+ }
375
+ class O11yObservableGuage {
376
+ constructor(logger) {
377
+ this.logger = logger;
378
+ }
379
+ addCallback(_callback) {
380
+ this.logger.warn("O11yObservableGuage not supported yet. Defaulting to noop.");
381
+ }
382
+ removeCallback(_callback) {
383
+ this.logger.warn("O11yObservableGuage not supported yet. Defaulting to noop.");
384
+ }
385
+ }
386
+ class O11yObservableUpDownCounter {
387
+ constructor(logger) {
388
+ this.logger = logger;
389
+ }
390
+ addCallback(_callback) {
391
+ this.logger.warn("O11yObservableUpDownCounter not supported yet. Defaulting to noop.");
392
+ }
393
+ removeCallback(_callback) {
394
+ this.logger.warn("O11yObservableUpDownCounter not supported yet. Defaulting to noop.");
395
+ }
396
+ }
397
+ function sanitizeAttributes(attributes) {
398
+ if (!attributes) return;
399
+ const metricTags = {};
400
+ Object.entries(attributes).forEach(([key, value]) => {
401
+ if (value !== void 0 && !Array.isArray(value)) {
402
+ metricTags[key] = value;
403
+ }
404
+ });
405
+ return metricTags;
406
+ }
407
+ class O11yInstrumentation {
408
+ constructor(services) {
409
+ this.services = services;
410
+ this.currentTimeMs = () => performance.now();
411
+ this.trace = new O11yOTelTraceAPI(this.services);
412
+ this.metrics = new O11yOTelMetricsAPI(this.services);
413
+ }
414
+ }
415
+ function buildServiceDescriptor(logger) {
416
+ return {
417
+ type: "instrumentation",
418
+ version: "1.0",
419
+ service: new O11yInstrumentation({ logger })
420
+ };
421
+ }
422
+ export {
423
+ buildServiceDescriptor$1 as buildNoopInstrumentationServiceDescriptor,
424
+ buildServiceDescriptor as buildO11yInstrumentationServiceDescriptor
425
+ };
426
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../instrumentation-noop/dist/v1/index.js","../../../instrumentation-o11y/dist/v1/index.js"],"sourcesContent":["/*!\n * Copyright (c) 2022, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nclass NoopOTelTraceAPI {\n getTracer(_name, _version, _options) {\n return new NoopTracer();\n }\n}\nclass NoopTracer {\n startSpan(_name, _options, _context) {\n return new NoopSpan();\n }\n startActiveSpan(name, options, context, fn) {\n let opts;\n let ctx;\n let fun;\n if (typeof options === \"function\") {\n fun = options;\n } else {\n opts = options;\n if (typeof context === \"function\") {\n fun = context;\n } else {\n ctx = context;\n fun = fn;\n }\n }\n const span = this.startSpan(name, opts, ctx);\n try {\n return fun(span);\n } finally {\n span.end();\n }\n }\n}\nclass NoopSpan {\n spanContext() {\n return {\n spanId: \"noopSpanId\",\n traceId: \"noopTraceId\",\n traceFlags: 0\n };\n }\n setAttribute(_key, _value) {\n return this;\n }\n setAttributes(_attributes) {\n return this;\n }\n addEvent(_name, _attributesOrStartTime, _startTime) {\n return this;\n }\n setStatus(_status) {\n return this;\n }\n updateName(_name) {\n return this;\n }\n end(_endTime) {\n return;\n }\n isRecording() {\n return false;\n }\n recordException(_exception, _time) {\n return;\n }\n}\nclass NoopOTelMetricsAPI {\n getMeter(__name, _version, __options) {\n return new NoopMeter();\n }\n}\nclass NoopMeter {\n createHistogram(_name, _options) {\n return new NoopHistogram();\n }\n createCounter(_name, _options) {\n return new NoopCounter();\n }\n createUpDownCounter(_name, _options) {\n return new NoopUpDownCounter();\n }\n createObservableGauge(_name, _options) {\n return new NoopObservableGuage();\n }\n createObservableCounter(_name, _options) {\n return new NoopObservableCounter();\n }\n createObservableUpDownCounter(_name, _options) {\n return new NoopObservableUpDownCounter();\n }\n addBatchObservableCallback(_callback, _observables) {\n return;\n }\n removeBatchObservableCallback(_callback, _observables) {\n return;\n }\n}\nclass NoopCounter {\n add(_value, _attributes, _context) {\n return;\n }\n}\nclass NoopHistogram {\n record(_value, _attributes, _context) {\n return;\n }\n}\nclass NoopUpDownCounter {\n add(_value, _attributes, _context) {\n return;\n }\n}\nclass NoopObservableCounter {\n addCallback(_callback) {\n return;\n }\n removeCallback(_callback) {\n return;\n }\n}\nclass NoopObservableGuage {\n addCallback(_callback) {\n return;\n }\n removeCallback(_callback) {\n return;\n }\n}\nclass NoopObservableUpDownCounter {\n addCallback(_callback) {\n return;\n }\n removeCallback(_callback) {\n return;\n }\n}\nfunction buildServiceDescriptor() {\n return {\n type: \"instrumentation\",\n version: \"1.0\",\n service: {\n trace: new NoopOTelTraceAPI(),\n metrics: new NoopOTelMetricsAPI(),\n currentTimeMs: () => 0\n }\n };\n}\nexport {\n buildServiceDescriptor\n};\n//# sourceMappingURL=index.js.map\n","/*!\n * Copyright (c) 2022, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport { getInstrumentation } from \"o11y/client\";\nclass O11yOTelTraceAPI {\n constructor(services) {\n this.services = services;\n }\n getTracer(name, _version, _options) {\n const o11yInstrumentation = getInstrumentation(name);\n return new O11yTracer(o11yInstrumentation, this.services.logger);\n }\n}\nclass O11yTracer {\n constructor(o11yInstrumentation, logger) {\n this.o11yInstrumentation = o11yInstrumentation;\n this.logger = logger;\n }\n startSpan(name, _options, context) {\n const traceId = context == null ? void 0 : context.getValue(Symbol.for(\"traceId\"));\n const spanId = context == null ? void 0 : context.getValue(Symbol.for(\"spanId\"));\n const traceFlags = context == null ? void 0 : context.getValue(Symbol.for(\"traceFlags\"));\n let spanContext = void 0;\n if (traceId !== void 0 && spanId !== void 0 && traceFlags !== void 0) {\n spanContext = {\n traceId,\n spanId,\n traceFlags\n };\n }\n const activityOptions = spanContext === void 0 ? void 0 : {\n instrumentationContext: {\n rootId: spanContext.traceId,\n isRootActivitySampled: spanContext.traceFlags === 1,\n parentId: spanId\n }\n };\n const activity = this.o11yInstrumentation.startActivity(name, activityOptions);\n return new O11ySpan(activity, this.logger);\n }\n startActiveSpan(name, options, context, fn) {\n let opts;\n let ctx;\n let fun;\n if (typeof options === \"function\") {\n fun = options;\n } else {\n opts = options;\n if (typeof context === \"function\") {\n fun = context;\n } else {\n ctx = context;\n fun = fn;\n }\n }\n const span = this.startSpan(name, opts, ctx);\n return fun(span);\n }\n}\nclass O11ySpan {\n constructor(activity, logger) {\n this.activity = activity;\n this.logger = logger;\n this._isRecording = true;\n this.attributes = {};\n }\n spanContext() {\n return {\n traceId: this.activity.getRootId(),\n spanId: this.activity.getId(),\n traceFlags: this.activity.getIsSampled() ? 1 : 0\n };\n }\n setAttribute(key, value) {\n this.attributes[key] = value;\n return this;\n }\n setAttributes(attributes) {\n this.attributes = { ...this.attributes, ...attributes };\n return this;\n }\n addEvent(_name, _attributesOrStartTime, _startTime) {\n this.logger.warn(\"O11ySpan does not support addEvents.\");\n return this;\n }\n setStatus(_status) {\n this.logger.warn(\"O11ySpan does not support setStatus.\");\n return this;\n }\n updateName(_name) {\n this.logger.warn(\"O11ySpan does not support updateName.\");\n return this;\n }\n end(endTime) {\n let endTimeInternal = endTime;\n try {\n if (typeof endTimeInternal !== \"number\") {\n this.logger.warn(\"O11ySpan does not support non number endTime override.\");\n endTimeInternal = void 0;\n }\n this.activity.stop(\n void 0,\n void 0,\n endTimeInternal ? { perfStopOverride: endTimeInternal } : void 0\n );\n } finally {\n this._isRecording = false;\n }\n return;\n }\n isRecording() {\n return this._isRecording;\n }\n recordException(exception, _time) {\n this.activity.error(exception);\n }\n}\nclass O11yOTelMetricsAPI {\n constructor(services) {\n this.services = services;\n }\n getMeter(name, _version, __options) {\n const o11yInstrumentation = getInstrumentation(name);\n return new O11yMeter(o11yInstrumentation, this.services.logger);\n }\n}\nclass O11yMeter {\n constructor(o11yInstrumentation, logger) {\n this.o11yInstrumentation = o11yInstrumentation;\n this.logger = logger;\n }\n createHistogram(name, _options) {\n return new O11yHistogram(name, this.o11yInstrumentation, this.logger);\n }\n createCounter(name, options) {\n if (options) {\n this.logger.warn(\"counter options not supported in O11y instrumentation\");\n }\n return new O11yCounter(name, this.o11yInstrumentation, this.logger);\n }\n createUpDownCounter(_name, _options) {\n return new O11yUpDownCounter(this.logger);\n }\n createObservableGauge(_name, _options) {\n return new O11yObservableGuage(this.logger);\n }\n createObservableCounter(_name, _options) {\n return new O11yObservableCounter(this.logger);\n }\n createObservableUpDownCounter(_name, _options) {\n return new O11yObservableUpDownCounter(this.logger);\n }\n addBatchObservableCallback(_callback, _observables) {\n this.logger.warn(\"addBatchObservableCallback not supported yet\");\n }\n removeBatchObservableCallback(_callback, _observables) {\n this.logger.warn(\"removeBatchObservableCallback not supported yet\");\n }\n}\nclass O11yCounter {\n constructor(name, o11yInstrumentation, logger) {\n this.name = name;\n this.o11yInstrumentation = o11yInstrumentation;\n this.logger = logger;\n }\n add(value, attributes, _context) {\n if (value < 0) {\n this.logger.warn(`Counter values must be non-negative. Got ${value}.`);\n return;\n }\n this.o11yInstrumentation.incrementCounter(\n this.name,\n value,\n void 0,\n sanitizeAttributes(attributes)\n );\n }\n}\nclass O11yHistogram {\n constructor(name, o11yInstrumentation, logger) {\n this.name = name;\n this.o11yInstrumentation = o11yInstrumentation;\n this.logger = logger;\n }\n record(value, attributes, _context) {\n if (value < 0) {\n this.logger.warn(`Histogram values must be non-negative. Got ${value}.`);\n return;\n }\n this.o11yInstrumentation.trackValue(\n this.name,\n value,\n void 0,\n sanitizeAttributes(attributes)\n );\n }\n}\nclass O11yUpDownCounter {\n constructor(logger) {\n this.logger = logger;\n }\n add(_value, _attributes, _context) {\n this.logger.warn(\"O11yUpDownCounter not supported yet.\");\n }\n}\nclass O11yObservableCounter {\n constructor(logger) {\n this.logger = logger;\n }\n addCallback(_callback) {\n this.logger.warn(\"O11yObservableCounter not supported yet. Defaulting to noop.\");\n }\n removeCallback(_callback) {\n this.logger.warn(\"O11yObservableCounter not supported yet. Defaulting to noop.\");\n }\n}\nclass O11yObservableGuage {\n constructor(logger) {\n this.logger = logger;\n }\n addCallback(_callback) {\n this.logger.warn(\"O11yObservableGuage not supported yet. Defaulting to noop.\");\n }\n removeCallback(_callback) {\n this.logger.warn(\"O11yObservableGuage not supported yet. Defaulting to noop.\");\n }\n}\nclass O11yObservableUpDownCounter {\n constructor(logger) {\n this.logger = logger;\n }\n addCallback(_callback) {\n this.logger.warn(\"O11yObservableUpDownCounter not supported yet. Defaulting to noop.\");\n }\n removeCallback(_callback) {\n this.logger.warn(\"O11yObservableUpDownCounter not supported yet. Defaulting to noop.\");\n }\n}\nfunction sanitizeAttributes(attributes) {\n if (!attributes) return;\n const metricTags = {};\n Object.entries(attributes).forEach(([key, value]) => {\n if (value !== void 0 && !Array.isArray(value)) {\n metricTags[key] = value;\n }\n });\n return metricTags;\n}\nclass O11yInstrumentation {\n constructor(services) {\n this.services = services;\n this.currentTimeMs = () => performance.now();\n this.trace = new O11yOTelTraceAPI(this.services);\n this.metrics = new O11yOTelMetricsAPI(this.services);\n }\n}\nfunction buildServiceDescriptor(logger) {\n return {\n type: \"instrumentation\",\n version: \"1.0\",\n service: new O11yInstrumentation({ logger })\n };\n}\nexport {\n buildServiceDescriptor\n};\n//# sourceMappingURL=index.js.map\n"],"names":["buildServiceDescriptor"],"mappings":";;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,MAAM,iBAAiB;AAAA,EACrB,UAAU,OAAO,UAAU,UAAU;AACnC,WAAO,IAAI,WAAU;AAAA,EACvB;AACF;AACA,MAAM,WAAW;AAAA,EACf,UAAU,OAAO,UAAU,UAAU;AACnC,WAAO,IAAI,SAAQ;AAAA,EACrB;AAAA,EACA,gBAAgB,MAAM,SAAS,SAAS,IAAI;AAC1C,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI,OAAO,YAAY,YAAY;AACjC,YAAM;AAAA,IACR,OAAO;AACL,aAAO;AACP,UAAI,OAAO,YAAY,YAAY;AACjC,cAAM;AAAA,MACR,OAAO;AACL,cAAM;AACN,cAAM;AAAA,MACR;AAAA,IACF;AACA,UAAM,OAAO,KAAK,UAAU,MAAM,MAAM,GAAG;AAC3C,QAAI;AACF,aAAO,IAAI,IAAI;AAAA,IACjB,UAAC;AACC,WAAK,IAAG;AAAA,IACV;AAAA,EACF;AACF;AACA,MAAM,SAAS;AAAA,EACb,cAAc;AACZ,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,YAA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;AACtC,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS,IAAI,oBAAoB,EAAE,OAAM,CAAE;AAAA,EAC/C;AACA;"}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@conduit-client/service-instrumentation",
3
+ "version": "5.67.0-dev1",
4
+ "private": false,
5
+ "description": "Luvio Instrumentation Service definition",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/salesforce-experience-platform-emu/luvio-next.git",
10
+ "directory": "packages/@conduit-client/services/instrumentation"
11
+ },
12
+ "license": "SEE LICENSE IN LICENSE.txt",
13
+ "exports": {
14
+ "./v1": {
15
+ "import": "./dist/v1/index.js",
16
+ "types": "./dist/types/v1/index.d.ts",
17
+ "require": "./dist/v1/index.js"
18
+ }
19
+ },
20
+ "main": "./dist/main/index.js",
21
+ "module": "./dist/main/index.js",
22
+ "types": "./dist/main/index.d.ts",
23
+ "files": [
24
+ "dist/"
25
+ ],
26
+ "scripts": {
27
+ "build": "vite build && tsc --build --emitDeclarationOnly",
28
+ "clean": "rm -rf dist",
29
+ "test": "vitest run",
30
+ "test:size": "size-limit",
31
+ "watch": "npm run build --watch"
32
+ },
33
+ "dependencies": {
34
+ "@conduit-client/service-instrumentation-noop": "5.67.0-dev1",
35
+ "@conduit-client/service-instrumentation-o11y": "5.67.0-dev1",
36
+ "@conduit-client/service-instrumentation-types": "5.67.0-dev1",
37
+ "@conduit-client/utils": "5.67.0-dev1"
38
+ },
39
+ "devDependencies": {
40
+ "@conduit-client/command-base": "5.67.0-dev1"
41
+ },
42
+ "volta": {
43
+ "extends": "../../../../package.json"
44
+ },
45
+ "size-limit": [
46
+ {
47
+ "path": "./dist/v1/index.js",
48
+ "limit": "2 kB"
49
+ }
50
+ ]
51
+ }