@composed-di/instrumentation-core 0.7.0-alpha → 0.8.0-alpha
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/redaction.d.ts +1 -1
- package/dist/serviceInstrumentation.d.ts +5 -5
- package/dist/serviceInstrumentation.d.ts.map +1 -1
- package/dist/serviceInstrumentation.js +2 -2
- package/dist/serviceInstrumentation.js.map +1 -1
- package/package.json +2 -2
- package/src/redaction.ts +1 -1
- package/src/serviceInstrumentation.ts +5 -5
package/dist/redaction.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type Mask<T, K extends Extract<keyof T, string>> = T[K] extends (...args:
|
|
|
19
19
|
/**
|
|
20
20
|
* Marks a service — or specific properties of it — as sensitive, so the
|
|
21
21
|
* values flowing through its events are redacted. Passed to
|
|
22
|
-
* {@link ServiceInstrumentation.
|
|
22
|
+
* {@link ServiceInstrumentation.install} via the capture options' `redact` list and applied
|
|
23
23
|
* centrally, after the capture flags: values a rule matches are scrubbed
|
|
24
24
|
* before the instrumentation ever sees them, and when capture is off
|
|
25
25
|
* there is nothing to redact. Returned by
|
|
@@ -47,7 +47,7 @@ export interface OperationSpan {
|
|
|
47
47
|
* dispose outcomes never carry one); `failure` carries the error that was
|
|
48
48
|
* thrown or rejected.
|
|
49
49
|
*
|
|
50
|
-
* Whether `value` is present is decided by {@link ServiceInstrumentation.
|
|
50
|
+
* Whether `value` is present is decided by {@link ServiceInstrumentation.install},
|
|
51
51
|
* not by the implementation: it is absent unless result capture is enabled
|
|
52
52
|
* in the InstrumentOptions, and holds the redacted value when a redaction
|
|
53
53
|
* rule matches. Implementations must record the value exactly when it is
|
|
@@ -106,7 +106,7 @@ export interface MethodCallContext {
|
|
|
106
106
|
* The arguments to report for this call, passed by reference;
|
|
107
107
|
* implementations must not mutate them.
|
|
108
108
|
*
|
|
109
|
-
* Whether they are present is decided by {@link ServiceInstrumentation.
|
|
109
|
+
* Whether they are present is decided by {@link ServiceInstrumentation.install},
|
|
110
110
|
* not by the implementation: absent unless argument capture is enabled in
|
|
111
111
|
* the InstrumentOptions, and already redacted when a redaction rule
|
|
112
112
|
* matches. Implementations must record the arguments exactly when present
|
|
@@ -145,7 +145,7 @@ export interface CaptureOptions {
|
|
|
145
145
|
redact?: readonly RedactionRule<any>[];
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
|
-
* Configuration for {@link ServiceInstrumentation.
|
|
148
|
+
* Configuration for {@link ServiceInstrumentation.install}. Capture
|
|
149
149
|
* policy lives here, not in the ServiceInstrumentation subclasses: what a
|
|
150
150
|
* subclass receives is exactly what it is allowed to record, so no
|
|
151
151
|
* subclass carries its own capture flags or redaction logic.
|
|
@@ -161,7 +161,7 @@ export interface InstrumentOptions {
|
|
|
161
161
|
/**
|
|
162
162
|
* Base class for instrumenting services. Extend it and override the hooks
|
|
163
163
|
* to observe lifecycle events and method calls of the services wrapped by
|
|
164
|
-
* {@link ServiceInstrumentation.
|
|
164
|
+
* {@link ServiceInstrumentation.install}.
|
|
165
165
|
*
|
|
166
166
|
* Instrumentation is strictly observational: subclasses see every
|
|
167
167
|
* operation but must never alter it — see the OperationSpan contract.
|
|
@@ -222,7 +222,7 @@ export declare class ServiceInstrumentation {
|
|
|
222
222
|
* anything reaches this instrumentation.
|
|
223
223
|
* @return The wrapped factories, ready to be passed to ServiceModule.from.
|
|
224
224
|
*/
|
|
225
|
-
|
|
225
|
+
install(entries: (ServiceModule | GenericFactory)[], options?: InstrumentOptions): GenericFactory[];
|
|
226
226
|
}
|
|
227
227
|
export {};
|
|
228
228
|
//# sourceMappingURL=serviceInstrumentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceInstrumentation.d.ts","sourceRoot":"","sources":["../src/serviceInstrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC7E,OAAO,KAAK,EAAE,aA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AC3C,OAAO,GAAE,iBAAsB,GAC9B,cAAc,EAAE;CAKpB"}
|
|
@@ -14,7 +14,7 @@ const core_1 = require("@composed-di/core");
|
|
|
14
14
|
/**
|
|
15
15
|
* Base class for instrumenting services. Extend it and override the hooks
|
|
16
16
|
* to observe lifecycle events and method calls of the services wrapped by
|
|
17
|
-
* {@link ServiceInstrumentation.
|
|
17
|
+
* {@link ServiceInstrumentation.install}.
|
|
18
18
|
*
|
|
19
19
|
* Instrumentation is strictly observational: subclasses see every
|
|
20
20
|
* operation but must never alter it — see the OperationSpan contract.
|
|
@@ -53,7 +53,7 @@ class ServiceInstrumentation {
|
|
|
53
53
|
* anything reaches this instrumentation.
|
|
54
54
|
* @return The wrapped factories, ready to be passed to ServiceModule.from.
|
|
55
55
|
*/
|
|
56
|
-
|
|
56
|
+
install(entries, options = {}) {
|
|
57
57
|
return entries
|
|
58
58
|
.flatMap((e) => (e instanceof core_1.ServiceModule ? e.factories : [e]))
|
|
59
59
|
.map((factory) => instrumentedServiceFactory(this, options, factory));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceInstrumentation.js","sourceRoot":"","sources":["../src/serviceInstrumentation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA6E;AA2K7E;;;;;;;;;;;GAWG;AACH,MAAa,sBAAsB;IA0BjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,
|
|
1
|
+
{"version":3,"file":"serviceInstrumentation.js","sourceRoot":"","sources":["../src/serviceInstrumentation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA6E;AA2K7E;;;;;;;;;;;GAWG;AACH,MAAa,sBAAsB;IA0BjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,OAAO,CACL,OAA2C,EAC3C,UAA6B,EAAE;QAE/B,OAAO,OAAO;aACX,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,oBAAa,CAAC,CA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;;IAChC,MAAM,IAAI,GAAG,MAAA,KAAK,CAAC,WAAW,0CAAE,IAAI,CAAA;IACpC,OAAO,IAAI,IAAI,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@composed-di/instrumentation-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-alpha",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dependency injection",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@composed-di/core": "^0.
|
|
38
|
+
"@composed-di/core": "^0.8.0-alpha"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsc --build",
|
package/src/redaction.ts
CHANGED
|
@@ -39,7 +39,7 @@ interface PropertyOverride {
|
|
|
39
39
|
/**
|
|
40
40
|
* Marks a service — or specific properties of it — as sensitive, so the
|
|
41
41
|
* values flowing through its events are redacted. Passed to
|
|
42
|
-
* {@link ServiceInstrumentation.
|
|
42
|
+
* {@link ServiceInstrumentation.install} via the capture options' `redact` list and applied
|
|
43
43
|
* centrally, after the capture flags: values a rule matches are scrubbed
|
|
44
44
|
* before the instrumentation ever sees them, and when capture is off
|
|
45
45
|
* there is nothing to redact. Returned by
|
|
@@ -51,7 +51,7 @@ export interface OperationSpan {
|
|
|
51
51
|
* dispose outcomes never carry one); `failure` carries the error that was
|
|
52
52
|
* thrown or rejected.
|
|
53
53
|
*
|
|
54
|
-
* Whether `value` is present is decided by {@link ServiceInstrumentation.
|
|
54
|
+
* Whether `value` is present is decided by {@link ServiceInstrumentation.install},
|
|
55
55
|
* not by the implementation: it is absent unless result capture is enabled
|
|
56
56
|
* in the InstrumentOptions, and holds the redacted value when a redaction
|
|
57
57
|
* rule matches. Implementations must record the value exactly when it is
|
|
@@ -112,7 +112,7 @@ export interface MethodCallContext {
|
|
|
112
112
|
* The arguments to report for this call, passed by reference;
|
|
113
113
|
* implementations must not mutate them.
|
|
114
114
|
*
|
|
115
|
-
* Whether they are present is decided by {@link ServiceInstrumentation.
|
|
115
|
+
* Whether they are present is decided by {@link ServiceInstrumentation.install},
|
|
116
116
|
* not by the implementation: absent unless argument capture is enabled in
|
|
117
117
|
* the InstrumentOptions, and already redacted when a redaction rule
|
|
118
118
|
* matches. Implementations must record the arguments exactly when present
|
|
@@ -155,7 +155,7 @@ export interface CaptureOptions {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
|
-
* Configuration for {@link ServiceInstrumentation.
|
|
158
|
+
* Configuration for {@link ServiceInstrumentation.install}. Capture
|
|
159
159
|
* policy lives here, not in the ServiceInstrumentation subclasses: what a
|
|
160
160
|
* subclass receives is exactly what it is allowed to record, so no
|
|
161
161
|
* subclass carries its own capture flags or redaction logic.
|
|
@@ -172,7 +172,7 @@ export interface InstrumentOptions {
|
|
|
172
172
|
/**
|
|
173
173
|
* Base class for instrumenting services. Extend it and override the hooks
|
|
174
174
|
* to observe lifecycle events and method calls of the services wrapped by
|
|
175
|
-
* {@link ServiceInstrumentation.
|
|
175
|
+
* {@link ServiceInstrumentation.install}.
|
|
176
176
|
*
|
|
177
177
|
* Instrumentation is strictly observational: subclasses see every
|
|
178
178
|
* operation but must never alter it — see the OperationSpan contract.
|
|
@@ -236,7 +236,7 @@ export class ServiceInstrumentation {
|
|
|
236
236
|
* anything reaches this instrumentation.
|
|
237
237
|
* @return The wrapped factories, ready to be passed to ServiceModule.from.
|
|
238
238
|
*/
|
|
239
|
-
|
|
239
|
+
install(
|
|
240
240
|
entries: (ServiceModule | GenericFactory)[],
|
|
241
241
|
options: InstrumentOptions = {},
|
|
242
242
|
): GenericFactory[] {
|